Beautiful array
Many people mistakenly believe that Cossack Vus's favorite number is seven. In reality, his favorite number is two. Consequently, he only appreciates arrays that contain exactly two distinct numbers.
However, arrays with just two different numbers often appear chaotic to him, and Cossack Vus despises chaos. Therefore, he prefers arrays where every pair of adjacent elements are different.
Formally, for Vus to like an array, the following conditions must be satisfied:
for all ();
for all ().
For example, he likes the array . This array contains only two different numbers, and , and no two adjacent numbers are the same. However, he does not like the arrays (because there are three different numbers), (because there are identical adjacent elements and only one number), or (because there are identical adjacent elements).
Given an array with integers , you need to determine the minimum number of elements that must be changed for the array to be liked by Cossack Vus. Find this minimum number.
For instance, in the array , you need to change the second and fourth elements to any other number. Therefore, in this example, the answer is .
Input
The first line contains a single integer () — the number of elements in the array.
The second line contains integers () — the elements of the array.
Output
Output the minimum number of elements that need to be changed for the array to be liked by the Cossack.
Examples
Scoring
Solutions that work correctly under the constraints and will receive points.