Deep in the marshes of Vvardenfell, there is a mudcrab. Not just any mudcrab — the mudcrab. The one with 10,000 gold and nothing to sell. Travelers come from across Morrowind just to stare at him.
His name, as far as anyone can tell, is Gerald.
Gerald has recently decided to expand his business. He has acquired exactly N soul gems, each engraved with a number by some bored Telvanni wizard. A complete collection means having exactly one gem for each number from 1 to N no duplicates, no missing numbers. The order on the shelf doesn't matter. Gerald just wants one of each.
The problem is the wizard was drunk. Some numbers were engraved twice. Some were skipped entirely. Gerald now has N soul gems, but the numbers are a mess.
Gerald can trade with a merchant in Balmora giving one of his gems for any other gem. But every trip through the swamp is exhausting, and Gerald, despite being a successful business-crab, would rather minimize travel.
Help Gerald figure out the minimum number of trades needed so that his collection contains exactly one gem of each number from 1 to N.
The first line contains a single integer $$$N$$$ $$$(1 \leq N \leq 10^5)$$$: the number of soul gems Gerald owns.
The second line contains $$$N$$$ integers $$$a_1, a_2, \ldots, a_N (1 \leq a_i \leq N)$$$: the number engraved on each soul gem.
Print a single integer: the minimum number of trades needed so that Gerald has exactly one gem for each number from $$$1$$$ to $$$N$$$. The gems do not need to be in any particular order — Gerald just needs one of each.
51 2 3 4 5
0
51 1 2 4 4
2
33 2 2
1