URI Online Judge | 2733

The Reader's Locker

By Valeska Uchôa, UFPI BR Brazil

Timelimit: 1

Carla owns a vast collection of books containing 100 copies. She spends a lot of time in college so she likes to leave some of them in her closet. However, the closet has room for only 4 books, one compartment for each one.

She is very organized person, therefore she keeps track of every time she wants to read a book. The books stored in her locker are chosen as follows: when Carla wants to read a book that is not in her locker, she brings it the next day and puts it in the place of the least recently read book. Each book has an associated ID that is a number from 1 to 100.

Given a sequence of books read, her algorithm must determine the number of times Carla wanted to read a book that was not in her locker.

Input

The first line is an integer N representing the number of book Carla wants do read. The next N lines are integers L1, L2, ..., LN \((1 \leq L_i \leq 100)\) representing the IDs of the books Carla wanted to read. Input finishes when an EOF is found.

Output

Outputs an integer representing the number of times Carla wanted to read a book that was not in her locker.

Input Sample Output Sample

10
1
45
23
73
56
23
23
1
45
89

8