23. King Qi and General Tian Ji had a horse race. Each had three horses, divided into three classes. Tian Ji knew that the fastest of the six horses was King Qi's first-class horse, followed by his own first-class horse, King Qi's second-class horse, his own second-class horse, King Qi's third-class horse, and his own third-class horse. Tian Ji also knew that King Qi's horses would appear in the order of first-class, second-class, and third-class. Therefore, Tian Ji has $\qquad$ ways to arrange the order of his three horses to ensure that he wins at least one race.
$5$