#OLD392. The Trouble Dinner

The Trouble Dinner

Description

In the gamble game, Melo won Elliott a lot of gold, so Melo decided to invite the whole acm-lab team to dinner. They went to a western restaurant, but they had a problem in ordering.

Each dish in the ordering system has a unique IDID. When ordering, each character is input one by one, the system will check whether the dish IDID exists in previous order history, and if it matches successfully, the system will order the previous dish again.

Obviously, it may result in ordering unnecessary dishes. If Melo has input the IDID of all the dishes he want to order in the meal system in sequence. If Melo input the ID of all the dishes, anwser how many unnecessary dishes will be ordered.

Format

Input

The input contains multiple cases.

In each case, the first line contains a integer nn (1n100001\leq n \leq 10000), representing the number of dishes Melo want to order.

For the next nn lines each line has a number IDID, representing the IDID of each dish. (1ID10121\leq ID \leq 10^{12})

Output

Print the answer that number of extra dishes will are ordered.

Samples

5
1
10
12580
10086
10010

6

Hint

While input 10, the systems will order the dish whose IDID is 1;

then input 12580, it will order 1 again;

input 10086 it will order 1 and 10 two dishes;

input 10010, it wil order 1 and 10 as above one. So the answer is 6.