五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 52A - 123-sequence

2023-07-15 11:46 作者:您是打尖兒還是住店呢  | 我要投稿

There is a given sequence of integers?a1,?a2,?...,?an, 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?≤?106). The second line contains a sequence of integers?a1,?a2,?...,?an?(1?≤?ai?≤?3).

Output

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

Examples

input

9
1 3 2 2 2 1 1 2 3

output

5

Note

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

-------------------------------------

判斷每個元素的數(shù)量,將最小的2個加起來就是所有的需要的信息了,(這里面用一下數(shù)組的排序功能);

下面是代碼:


CF 52A - 123-sequence的評論 (共 條)

分享到微博請遵守國家法律
白银市| 怀化市| 贡山| 花莲县| 沈阳市| 永福县| 佛山市| 华坪县| 金门县| 广饶县| 马边| 五指山市| 苏州市| 阿拉善左旗| 涞水县| 阳谷县| 水富县| 长兴县| 固始县| 元谋县| 卫辉市| 盈江县| 夏津县| 壶关县| 滁州市| 荔浦县| 普洱| 措勤县| 东乡| 株洲县| 普宁市| 奇台县| 佳木斯市| 商水县| 肃北| 吉林省| 仙居县| 韶关市| 澜沧| 玛沁县| 柘荣县|