Buggy python submission (verdict: Runtime Error):
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(1,10**5+1)]

odd = [[int(x),0] for x in range(1,10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])


Fixed submission:
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(10**5+1)]

odd = [[int(x),0] for x in range(10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])

Buggy python submission (verdict: Runtime Error):
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(1,10**5+1)]

odd = [[int(x),0] for x in range(1,10**5/2+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])


Fixed submission:
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(10**5+1)]

odd = [[int(x),0] for x in range(10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])

Buggy python submission (verdict: Runtime Error):
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(1,10**5/2+1)]

odd = [[int(x),0] for x in range(1,10**5+1/2+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])


Fixed submission:
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(10**5+1)]

odd = [[int(x),0] for x in range(10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])

Buggy python submission (verdict: Runtime Error):
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(1,10**5+1)]

odd = [[int(x),0] for x in range(1,10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])


Fixed submission:
n = int(input())

c = [int(x) for x in input().split()]

even = [[int(x),0] for x in range(10**5+1)]

odd = [[int(x),0] for x in range(10**5+1)]

for i in range(len(c)):
    if i % 2 == 0:
        even[c[i]][1] += 1
    else:
        odd[c[i]][1] += 1

even = sorted(even,key = lambda x:-x[1])
odd = sorted(odd,key = lambda x:-x[1])

if even[0][0] == odd[0][0]:
    print(min(n-even[0][1]-odd[1][1],n-even[1][1]-odd[0][1]))
else:
    print(n-even[0][1]-odd[0][1])