For a math tournament, each person is assigned an ID which consists of two uppercase letters followed by two digits. All IDs have the property that either the letters are the same, the digits are the same, or both the letters are the same and the digits are the same. Compute the number of possible IDs that the tournament can generate.

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