Frequent value - MarisaOJ: Marisa Online Judge

Frequent value

Time limit: 1000 ms
Memory limit: 256 MB
You are given an array $A$ of length $n$. How many values appear more than 2 times in $A$? ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print a single integer, the number of values appear more than 2 times in $A$. ### Constraints - $1 \le n \le 10^5$. - $|A_i| \le 10^5 $. ### Example Input: ``` 7 -1 2 3 2 2 3 -1 ``` Output: ``` 1 ```