Problem:
On the blackboard there is written a 17-digit number made up only of 1s and 2s. Paolo comes in and rewrites the number in reverse order, lining it up under the previous one. Gianni comes in and writes under each column the maximum digit that appears in that column. Alberto comes in and writes under each column the minimum digit that appears in that column, then erases the first two rows. Carla comes in and finds written the numbers 12212212221221221 and 11211111211111211, and is told what Paolo, Gianni, and Alberto did. How many different numbers could have been written on the blackboard as the first number?