Balloons
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The seller has n balloons. Each balloon has some color. However, recently Three Fat Men issued a decree permitting to sell the balls of a single color. In order not to break the law, but not to lose profits, the seller decided to repaint some of his balls.
Write a program to determine the minimum number of repainting.
Input
First line contains the number of balloons n (1 ≤ n ≤ 10^5
). Second line contains n integers in the range from 1 to 9, determining the colors of the balls (1 - blue, 2 - green, 3 - cyan, 4 - red, 5 - rose, 6 - yellow, 7 - gray, 8 - black, 9 - white).
Output
Print the minimum number of balloons to repaint so that all balls have the same color.
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #9
Answer #9
Submissions 14K
Acceptance rate 45%