import collections

n = int(eval(input()))

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

v1 = [v[i*2+1] for i in range(n//2)]

v2 = [v[i*2] for i in range(n//2)]

c1 = collections.Counter(v1).most_common()

c2 = collections.Counter(v2).most_common()



if len(set(v1)) == len(set(v2)) == 1:

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

    print((0))

  else:

    print((min(len(v1), len(v2))))

elif len(set(v1))==1:

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

    print((sum([i[1] for i in c2])-c2[0][1]))

  else:

    print((sum([i[1] for i in c2])-c2[1][1]))

elif len(set(v2))==1:

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

    print((sum([i[1] for i in c1])-c1[0][1]))

  else:

    print((sum([i[1] for i in c1])-c1[1][1]))

else:

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

    print(((sum([i[1] for i in c1])-c1[0][1]) + (sum([i[1] for i in c2])-c2[0][1])))

  else:

    print((min((sum([i[1] for i in c1])-c1[0][1])+(sum([i[1] for i in c2])-c2[1][1]),

              (sum([i[1] for i in c1])-c1[1][1])+(sum([i[1] for i in c2])-c2[0][1]))))
import collections

n = int(eval(input()))

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

v1 = v[::2]

v2 = v[1::2]

c1 = collections.Counter(v1).most_common()

c2 = collections.Counter(v2).most_common()



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

  print((len(v1)-c1[0][1] + len(v2)-c2[0][1]))

else:

  if len(c1) == len(c2) == 1:

    print((n // 2))

  elif len(c1) == 1:

    print((len(v2)-c2[1][1]))

  elif len(c2) == 1:

    print((len(v1)-c1[1][1]))

  else:

    print((min(len(v1)-c1[0][1]+len(v2)-c2[1][1], len(v1)-c1[1][1]+len(v2)-c2[0][1])))
import collections

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = [v[i * 2 + 1] for i in range(n // 2)]
v2 = [v[i * 2] for i in range(n // 2)]
c1 = collections.Counter(v1).most_common()
c2 = collections.Counter(v2).most_common()
if len(set(v1)) == len(set(v2)) == 1:
    if c1[0][0] != c2[0][0]:
        print((0))
    else:
        print((min(len(v1), len(v2))))
elif len(set(v1)) == 1:
    if c1[0][0] != c2[0][0]:
        print((sum([i[1] for i in c2]) - c2[0][1]))
    else:
        print((sum([i[1] for i in c2]) - c2[1][1]))
elif len(set(v2)) == 1:
    if c1[0][0] != c2[0][0]:
        print((sum([i[1] for i in c1]) - c1[0][1]))
    else:
        print((sum([i[1] for i in c1]) - c1[1][1]))
else:
    if c1[0][0] != c2[0][0]:
        print(
            (
                (sum([i[1] for i in c1]) - c1[0][1])
                + (sum([i[1] for i in c2]) - c2[0][1])
            )
        )
    else:
        print(
            (
                min(
                    (sum([i[1] for i in c1]) - c1[0][1])
                    + (sum([i[1] for i in c2]) - c2[1][1]),
                    (sum([i[1] for i in c1]) - c1[1][1])
                    + (sum([i[1] for i in c2]) - c2[0][1]),
                )
            )
        )

import collections

n = int(eval(input()))
v = list(map(int, input().split()))
v1 = v[::2]
v2 = v[1::2]
c1 = collections.Counter(v1).most_common()
c2 = collections.Counter(v2).most_common()
if c1[0][0] != c2[0][0]:
    print((len(v1) - c1[0][1] + len(v2) - c2[0][1]))
else:
    if len(c1) == len(c2) == 1:
        print((n // 2))
    elif len(c1) == 1:
        print((len(v2) - c2[1][1]))
    elif len(c2) == 1:
        print((len(v1) - c1[1][1]))
    else:
        print(
            (
                min(
                    len(v1) - c1[0][1] + len(v2) - c2[1][1],
                    len(v1) - c1[1][1] + len(v2) - c2[0][1],
                )
            )
        )

-v1 = [v[i * 2 + 1] for i in range(n // 2)] -v2 = [v[i * 2] for i in range(n // 2)] +v1 = v[::2] +v2 = v[1::2] -if len(set(v1)) == len(set(v2)) == 1: -    if c1[0][0] != c2[0][0]: -        print((0)) -    else: -        print((min(len(v1), len(v2)))) -elif len(set(v1)) == 1: -    if c1[0][0] != c2[0][0]: -        print((sum([i[1] for i in c2]) - c2[0][1])) -    else: -        print((sum([i[1] for i in c2]) - c2[1][1])) -elif len(set(v2)) == 1: -    if c1[0][0] != c2[0][0]: -        print((sum([i[1] for i in c1]) - c1[0][1])) -    else: -        print((sum([i[1] for i in c1]) - c1[1][1])) +if c1[0][0] != c2[0][0]: +    print((len(v1) - c1[0][1] + len(v2) - c2[0][1])) -    if c1[0][0] != c2[0][0]: -        print( -            ( -                (sum([i[1] for i in c1]) - c1[0][1]) -                + (sum([i[1] for i in c2]) - c2[0][1]) -            ) -        ) +    if len(c1) == len(c2) == 1: +        print((n // 2)) +    elif len(c1) == 1: +        print((len(v2) - c2[1][1])) +    elif len(c2) == 1: +        print((len(v1) - c1[1][1])) -                    (sum([i[1] for i in c1]) - c1[0][1]) -                    + (sum([i[1] for i in c2]) - c2[1][1]), -                    (sum([i[1] for i in c1]) - c1[1][1]) -                    + (sum([i[1] for i in c2]) - c2[0][1]), +                    len(v1) - c1[0][1] + len(v2) - c2[1][1], +                    len(v1) - c1[1][1] + len(v2) - c2[0][1],