Unique names

When creating a classroom, teachers want to have as many unique names as possible to avoid confusion. They ask you to write a program that would tell them how many unique names are there in a classroom each time a new student is added to the group. The final classroom consists of 5 people. So, the program gets 5 names in the input. Your task is to print the number of unique names after reading each new name.
Anna Bob Simon John Anna
1 2 3 4 4


Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue