Fake Tickets

No attempts yetTime limit1sMemory limit128 MB

Problem

Your school threw a big party to celebrate your team's win in the prestigious, world-famous ICPC (International Collegiate Poetry Contest). Everyone at school was invited to an evening of cocktails, dinner, and a reading of your team's work to the audience. The evening was a great success — far more people than you expected showed interest in your poetry — although some of your critics said it was the food, not the words, that drew such a crowd.

Whatever the reason, the next day you learned why the school hall had felt so full: the director confided that several of the tickets guests had used were fake. The genuine tickets were numbered sequentially from $1$ to $N$ ($N \le 10000$). The director suspects some guests used the scanner and printer in the Computer Room to copy real tickets. He hands you the pack of all tickets collected at the entrance and asks you to determine how many sequence numbers were duplicated — that is, how many numbers appear on more than one ticket in the pack.

Input

The input contains data for several test cases. Each test case consists of two lines. The first line has two integers $N$ and $M$, the number of genuine tickets and the number of guests attending the party, respectively ($1 \le N \le 10000$ and $1 \le M \le 20000$). The second line has $M$ integers $T_i$, the ticket numbers in the pack ($1 \le T_i \le N$). The end of input is indicated by a line with $N = M = 0$, which must not be processed.

Output

For each test case, print a single line containing the number of distinct sequence numbers that appear on more than one ticket in the pack.