Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

if Vodd == Veven:
    print(n // 2)


Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_val[1] - Voc_val[0], Vec_val[1] - Vec_val[0])

print(n - num)


Fixed submission:
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_cnt[1] - Voc_cnt[0], Vec_cnt[1] - Vec_cnt[0])

print(n - num)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

if Vodd == Veven:
    print(n // 2)


Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt += 0
    Vec_cnt += 0
    num += max(Voc_val[1] - Voc_val[0], Vec_val[1] - Vec_val[0])

print(n - num)


Fixed submission:
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_cnt[1] - Voc_cnt[0], Vec_cnt[1] - Vec_cnt[0])

print(n - num)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

for i in range(n):
    if V[0] != V[i]:
        break
    elif i == n - 1:
        print(min(len(Veven), len(Vodd)))
        exit()


Voc = Counter(Vodd)
Vec = Counter(Veven)

if Vodd == Veven:
    if Voc.most_common()[1][1] - Voc.most_common()[0][1] > Vec.most_common()[1][1] - Vec.most_common()[0][1]:
        num = Voc.most_common()[0][1] + Vec.most_common()[1][1]
else:
    num = Voc.most_common()[0][1] + Vec.most_common()[0][1]


print(n - num)


Fixed submission:
from collections import Counter

n = int(input())
V = list(map(int, input().split()))

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_cnt[1] - Voc_cnt[0], Vec_cnt[1] - Vec_cnt[0])

print(n - num)