100 atcoder#ARC103A. [ABC111C] /\/\/\/
[ABC111C] /\/\/\/
Score : points
Problem Statement
A sequence is said to be //// when the following conditions are satisfied:
- For each , .
- Exactly two different numbers appear in the sequence.
You are given a sequence whose length is even. We would like to make this sequence //// by replacing some of its elements. Find the minimum number of elements that needs to be replaced.
Constraints
- is even.
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of elements that needs to be replaced.
4
3 1 3 2
1
The sequence is not ////, but we can make it //// by replacing one of its elements: for example, replace the fourth element to make it .
6
105 119 105 119 105 119
0
The sequence is ////.
4
1 1 1 1
2
The elements of the sequence are all the same, so it is not ////.