Find the number of ordered triples $(A, B, C)$, where each letter represents a single digit, such that the set $\{AB_C, AC_B, BA_C, BC_A, CA_B, CB_A\}$ contains at most four distinct numbers?