Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1


pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:

	if max(p1) >= max(p2):

		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))


cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Fixed submission:
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1)+sorted(p2)[-2] >= sorted(p1)[-2]+max(p2):
		pp2 = p2.index(sorted(p2)[-2])
	else:
		pp1 = p1.index(sorted(p1)[-2])

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Fixed submission:
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1)+sorted(p2)[-2] >= sorted(p1)[-2]+max(p2):
		pp2 = p2.index(sorted(p2)[-2])
	else:
		pp1 = p1.index(sorted(p1)[-2])

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Fixed submission:
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1)+sorted(p2)[-2] >= sorted(p1)[-2]+max(p2):
		pp2 = p2.index(sorted(p2)[-2])
	else:
		pp1 = p1.index(sorted(p1)[-2])

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Fixed submission:
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1)+sorted(p2)[-2] >= sorted(p1)[-2]+max(p2):
		pp2 = p2.index(sorted(p2)[-2])
	else:
		pp1 = p1.index(sorted(p1)[-2])

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)