n=int(eval(input()))

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

a1=a[::2]

a2=a[1::2]

if a1==a2 and len(set(a1))==1:

    print((n//2))

    exit()

import collections as c

c1=c.Counter(a1)

c2=c.Counter(a2)

c1=c1.most_common()

c2=c2.most_common()

ans=0

if c1[0][0]==c2[0][0]:

    ans=min((n//2-c1[0][1])+(n//2-c2[1][1]),(n//2-c1[1][1])+(n//2-c2[0][1]))

else:

    ans=(n//2-c1[0][1])+(n//2-c2[0][1])

print(ans)
n=int(eval(input()))

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

a1=a[::2]

a2=a[1::2]

import collections

c1=collections.Counter(a1)

c2=collections.Counter(a2)

c1=c1.most_common(2)

c2=c2.most_common(2)

if a1==a2 and len(c1)==1 and len(c2)==1:

  print((len(a1)))

  exit()

if len(c1)==1 and len(c2)==1 and c1[0][0]!=c2[0][0]:

  print((0))

  exit()

ans=0

if c1[0][0]!=c2[0][0]:

  ans+=n-c1[0][1]-c2[0][1]

else:

  if len(c1)==1:

    ans+=len(a2)-c2[1][1]

  elif len(c2)==1:

    ans+=len(a1)-c1[1][1]

  else :

    ans=min(len(a1)-c1[0][1]+len(a2)-c2[1][1],len(a1)-c1[1][1]+len(a2)-c2[0][1])

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
a1 = a[::2]
a2 = a[1::2]
if a1 == a2 and len(set(a1)) == 1:
    print((n // 2))
    exit()
import collections as c

c1 = c.Counter(a1)
c2 = c.Counter(a2)
c1 = c1.most_common()
c2 = c2.most_common()
ans = 0
if c1[0][0] == c2[0][0]:
    ans = min(
        (n // 2 - c1[0][1]) + (n // 2 - c2[1][1]),
        (n // 2 - c1[1][1]) + (n // 2 - c2[0][1]),
    )
else:
    ans = (n // 2 - c1[0][1]) + (n // 2 - c2[0][1])
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a1 = a[::2]
a2 = a[1::2]
import collections

c1 = collections.Counter(a1)
c2 = collections.Counter(a2)
c1 = c1.most_common(2)
c2 = c2.most_common(2)
if a1 == a2 and len(c1) == 1 and len(c2) == 1:
    print((len(a1)))
    exit()
if len(c1) == 1 and len(c2) == 1 and c1[0][0] != c2[0][0]:
    print((0))
    exit()
ans = 0
if c1[0][0] != c2[0][0]:
    ans += n - c1[0][1] - c2[0][1]
else:
    if len(c1) == 1:
        ans += len(a2) - c2[1][1]
    elif len(c2) == 1:
        ans += len(a1) - c1[1][1]
    else:
        ans = min(
            len(a1) - c1[0][1] + len(a2) - c2[1][1],
            len(a1) - c1[1][1] + len(a2) - c2[0][1],
        )
print(ans)

-if a1 == a2 and len(set(a1)) == 1: -    print((n // 2)) +import collections + +c1 = collections.Counter(a1) +c2 = collections.Counter(a2) +c1 = c1.most_common(2) +c2 = c2.most_common(2) +if a1 == a2 and len(c1) == 1 and len(c2) == 1: +    print((len(a1))) -import collections as c - -c1 = c.Counter(a1) -c2 = c.Counter(a2) -c1 = c1.most_common() -c2 = c2.most_common() +if len(c1) == 1 and len(c2) == 1 and c1[0][0] != c2[0][0]: +    print((0)) +    exit() -if c1[0][0] == c2[0][0]: -    ans = min( -        (n // 2 - c1[0][1]) + (n // 2 - c2[1][1]), -        (n // 2 - c1[1][1]) + (n // 2 - c2[0][1]), -    ) +if c1[0][0] != c2[0][0]: +    ans += n - c1[0][1] - c2[0][1] -    ans = (n // 2 - c1[0][1]) + (n // 2 - c2[0][1]) +    if len(c1) == 1: +        ans += len(a2) - c2[1][1] +    elif len(c2) == 1: +        ans += len(a1) - c1[1][1] +    else: +        ans = min( +            len(a1) - c1[0][1] + len(a2) - c2[1][1], +            len(a1) - c1[1][1] + len(a2) - c2[0][1], +        )