Problem

Source: Moldova NMO 2002 grade 8 problem nr.4

Tags:



All the internal phone numbers in a certain company have four digits. The director wants the phone numbers of the administration offices to consist of digits $ 1$, $ 2$, $ 3$ only, and that any of these phone numbers coincide in at most one position. What is the maximum number of distinct phone numbers that these offices can have ?