404642: GYM101597 E Collection
Memory Limit:64 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
E. Collectiontime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output
Alan recently started collecting the cards of the well known "Famous Computer Scientists" card game by the ACM. As buying cards is starting to get expensive, he would like to start trading. To do this, he needs to know the number of duplicate cards in his collection. Write a program to help him calculate this number.
InputThe first line contains a single integer n, the number of cards in Alan's collection. The second line contains n integers ci, where ci is the id of the i-th card. It holds that 1 ≤ n ≤ 200'000 and 0 ≤ ci ≤ 109.
OutputPrint a single integer denoting the number of duplicates, that is the number of cards he can safely trade whilst still having the same number of unique cards.
ExamplesInput4Output
127 0 0 1
1Input
6Output
1 1 1000000 1 1 1
4