Daniel writes a list of positive integers, each less than or equal to 10, on a board from top to bottom. Next to each number in Daniel's list, Martin writes the number of times that number appears in Daniel's list, creating a new list of the same length. When Martin's list is read from bottom to top, it matches the list Daniel wrote from top to bottom. Find the maximum possible length of Daniel's list.

Let's think step by step and output the final answer within \boxed{}.
user