

n = int(eval(input()))

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



kisu = [0]*(10**6)

gusu = [0]*(10**6)

for i in range(n):

    if i % 2 == 0:

        gusu[v[i]] += 1

    else:

        kisu[v[i]] += 1



count = 0

gusu_m = gusu.index(max(gusu))

kisu_m = kisu.index(max(kisu))



if gusu_m == kisu_m:



    gusu[gusu_m] = 0

    kisu[kisu_m] = 0

    if max(gusu) > max(kisu):

        gusu_m = gusu.index(max(gusu))

    else:

        kisu_m = kisu.index(max(kisu))



for i in range(n):

    if i % 2 == 0 and gusu_m != v[i]:

        count += 1

    if i % 2 != 0 and kisu_m != v[i]:

        count += 1



print(count)

def main():

    n = int(eval(input()))

    # n, k = map(int, input().split())

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

    # s = input()



    even = [0] * (10 ** 5 + 100)

    odd = [0] * (10 ** 5 + 100)



    for i in range(n):

        if i % 2 == 0:

            even[v[i]] += 1

        else:

            odd[v[i]] += 1



    max_even = even.index(max(even))

    max_odd = odd.index(max(odd))



    if max_even == max_odd:

        even[max_even] = 0

        odd[max_odd] = 0

        if max(even) < max(odd):

            max_odd = odd.index(max(odd))

        else:

            max_even = even.index(max(even))

    ans = 0

    for i in range(n):

        if i % 2 == 0 and max_even != v[i]:

            ans += 1

        if i % 2 != 0 and max_odd != v[i]:

            ans += 1



    print(ans)





if __name__ == '__main__':

    main()

n = int(eval(input()))
v = list(map(int, input().split()))
kisu = [0] * (10**6)
gusu = [0] * (10**6)
for i in range(n):
    if i % 2 == 0:
        gusu[v[i]] += 1
    else:
        kisu[v[i]] += 1
count = 0
gusu_m = gusu.index(max(gusu))
kisu_m = kisu.index(max(kisu))
if gusu_m == kisu_m:
    gusu[gusu_m] = 0
    kisu[kisu_m] = 0
    if max(gusu) > max(kisu):
        gusu_m = gusu.index(max(gusu))
    else:
        kisu_m = kisu.index(max(kisu))
for i in range(n):
    if i % 2 == 0 and gusu_m != v[i]:
        count += 1
    if i % 2 != 0 and kisu_m != v[i]:
        count += 1
print(count)

def main():
    n = int(eval(input()))
    # n, k = map(int, input().split())
    v = list(map(int, input().split()))
    # s = input()
    even = [0] * (10**5 + 100)
    odd = [0] * (10**5 + 100)
    for i in range(n):
        if i % 2 == 0:
            even[v[i]] += 1
        else:
            odd[v[i]] += 1
    max_even = even.index(max(even))
    max_odd = odd.index(max(odd))
    if max_even == max_odd:
        even[max_even] = 0
        odd[max_odd] = 0
        if max(even) < max(odd):
            max_odd = odd.index(max(odd))
        else:
            max_even = even.index(max(even))
    ans = 0
    for i in range(n):
        if i % 2 == 0 and max_even != v[i]:
            ans += 1
        if i % 2 != 0 and max_odd != v[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-n = int(eval(input())) -v = list(map(int, input().split())) -kisu = [0] * (10**6) -gusu = [0] * (10**6) -for i in range(n): -    if i % 2 == 0: -        gusu[v[i]] += 1 -    else: -        kisu[v[i]] += 1 -count = 0 -gusu_m = gusu.index(max(gusu)) -kisu_m = kisu.index(max(kisu)) -if gusu_m == kisu_m: -    gusu[gusu_m] = 0 -    kisu[kisu_m] = 0 -    if max(gusu) > max(kisu): -        gusu_m = gusu.index(max(gusu)) -    else: -        kisu_m = kisu.index(max(kisu)) -for i in range(n): -    if i % 2 == 0 and gusu_m != v[i]: -        count += 1 -    if i % 2 != 0 and kisu_m != v[i]: -        count += 1 -print(count) +def main(): +    n = int(eval(input())) +    # n, k = map(int, input().split()) +    v = list(map(int, input().split())) +    # s = input() +    even = [0] * (10**5 + 100) +    odd = [0] * (10**5 + 100) +    for i in range(n): +        if i % 2 == 0: +            even[v[i]] += 1 +        else: +            odd[v[i]] += 1 +    max_even = even.index(max(even)) +    max_odd = odd.index(max(odd)) +    if max_even == max_odd: +        even[max_even] = 0 +        odd[max_odd] = 0 +        if max(even) < max(odd): +            max_odd = odd.index(max(odd)) +        else: +            max_even = even.index(max(even)) +    ans = 0 +    for i in range(n): +        if i % 2 == 0 and max_even != v[i]: +            ans += 1 +        if i % 2 != 0 and max_odd != v[i]: +            ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()