Codeforces Testing Round 1
A
123-sequence
Codeforces
900
原题
←B →
翻译中…

There is a given sequence of integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$, where every number is from 1 to 3 inclusively. You have to replace the minimum number of numbers in it so that all the numbers in the sequence are equal to each other.

翻译中…

Input

翻译中…

The first line contains an integer $*n*$ ($1 ≤ *n* ≤ 10^{6}$). The second line contains a sequence of integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 3$).

翻译中…

Output

翻译中…

Print the minimum number of replacements needed to be performed to make all the numbers in the sequence equal.

翻译中…

Note

翻译中…

In the example all the numbers equal to 1 and 3 should be replaced by 2.

翻译中…

样例

Input #1
9
1 3 2 2 2 1 1 2 3
Output #1
5
InputCopy OutputCopy
题目信息
题号
52A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。