#python3

from collections import Counter

n = int(eval(input()))

a = list(map(int, input().split()))



odd = [a[i] for i in range(n) if i%2==0]

even = [a[i] for i in range(n) if i%2!=0]



cntOdd = Counter(odd).most_common(2)

cntEven = Counter(even).most_common(2)



 



if cntOdd[0][0] != cntEven[0][0]:

    print((n - cntOdd[0][1] - cntEven[0][1]))

else:

    if len(cntEven) == 1 and len(cntEven):

        print((n//2))

    else:

        ans1 = n - cntOdd[1][1] - cntEven[0][1]

        ans2 = n - cntOdd[0][1] - cntEven[1][1]

        print((min(ans1, ans2)))





    

    

    
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from collections import Counter 

from collections import defaultdict

def main():

    n = int(readline())

    a = [int(i) for i in readline().split()]

    odd = Counter(a[::2]).most_common(2)

    even = Counter(a[1::2]).most_common(2)

    odd.append((-1, 0))

    even.append((-1, 0))

    if odd[0][0] == even[0][0]:

        print((min(n-odd[1][1]-even[0][1], n-odd[0][1]-even[1][1]))) 

    else:

        print((n-odd[0][1]-even[0][1]))

if __name__ == '__main__':

    main()

# python3
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
odd = [a[i] for i in range(n) if i % 2 == 0]
even = [a[i] for i in range(n) if i % 2 != 0]
cntOdd = Counter(odd).most_common(2)
cntEven = Counter(even).most_common(2)
if cntOdd[0][0] != cntEven[0][0]:
    print((n - cntOdd[0][1] - cntEven[0][1]))
else:
    if len(cntEven) == 1 and len(cntEven):
        print((n // 2))
    else:
        ans1 = n - cntOdd[1][1] - cntEven[0][1]
        ans2 = n - cntOdd[0][1] - cntEven[1][1]
        print((min(ans1, ans2)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import Counter
from collections import defaultdict


def main():
    n = int(readline())
    a = [int(i) for i in readline().split()]
    odd = Counter(a[::2]).most_common(2)
    even = Counter(a[1::2]).most_common(2)
    odd.append((-1, 0))
    even.append((-1, 0))
    if odd[0][0] == even[0][0]:
        print((min(n - odd[1][1] - even[0][1], n - odd[0][1] - even[1][1])))
    else:
        print((n - odd[0][1] - even[0][1]))


if __name__ == "__main__":
    main()

-# python3 +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +from collections import defaultdict -n = int(eval(input())) -a = list(map(int, input().split())) -odd = [a[i] for i in range(n) if i % 2 == 0] -even = [a[i] for i in range(n) if i % 2 != 0] -cntOdd = Counter(odd).most_common(2) -cntEven = Counter(even).most_common(2) -if cntOdd[0][0] != cntEven[0][0]: -    print((n - cntOdd[0][1] - cntEven[0][1])) -else: -    if len(cntEven) == 1 and len(cntEven): -        print((n // 2)) + +def main(): +    n = int(readline()) +    a = [int(i) for i in readline().split()] +    odd = Counter(a[::2]).most_common(2) +    even = Counter(a[1::2]).most_common(2) +    odd.append((-1, 0)) +    even.append((-1, 0)) +    if odd[0][0] == even[0][0]: +        print((min(n - odd[1][1] - even[0][1], n - odd[0][1] - even[1][1]))) -        ans1 = n - cntOdd[1][1] - cntEven[0][1] -        ans2 = n - cntOdd[0][1] - cntEven[1][1] -        print((min(ans1, ans2))) +        print((n - odd[0][1] - even[0][1])) + + +if __name__ == "__main__": +    main()