#ABC470B. 单色 / Monocolor

单色 / Monocolor

Problem Statement

There are NN balls. Each ball is painted in one of NN colors: color 11 through color NN. The color of the ii-th ball (1iN)(1\le i\le N) is CiC_i.

In one operation, you can change the color of any one ball to any of the NN colors.

Find the minimum number of operations required to make all the balls the same color.

Constraints

  • 1N1001\le N\le 100
  • 1CiN1\le C_i\le N
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

$N$
$C_1$ $C_2$ $\ldots$ $C_N$

Output

Output the answer.

4
3 1 2 1
2

By changing the color of the first ball to 11 and the color of the third ball to 11, you can make all the balls the same color.

It is impossible to make all the balls the same color by changing the colors of fewer than two balls, so output 22.

5
3 3 3 3 3
0

All balls may have the same color from the beginning.

9
4 2 3 3 4 1 2 7 1
7