Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
import sys


def Print(array):
    for r in range(len(array)):
        print(array[r])
    print()


def Gauss(array):
    # for r in range(len(array)):
    #     array[r].append(r)      # 繝斐?繝?ヨ驕ク謚槭＠縺溷セ? 譛?セ後↓謌サ縺吶◆繧√?繝槭?繧ォ繝シ

    for r in range(len(array)):  # 蜑埼?豸亥悉
        # array.sort(key=lambda x: x[r], reverse=True)  # 繝斐?繝?ヨ
        div = array[r][r]
        for c in range(r, len(array) + 1):  # 迴セ蝨ィ縺ョ陦後?蜈磯?縺?縺ォ縺ェ繧九ｈ縺?↓蜑イ繧?            array[r][c] /= div
        for r2 in range(r + 1, len(array)):      # 迴セ蝨ィ縺ョ陦後ｈ繧贋ク九?陦後?蜈磯?繧?縺ォ縺吶ｋ
            head = array[r2][r]
            for c in range(r, len(array) + 1):
                array[r2][c] -= head * array[r][c]

    result = [0] * len(array)
    for r in range(len(array) - 1, -1, -1):  # 蠕碁?莉」蜈・
        result[r] = array[r][
            len(array)] - sum([result[x] * array[r][x] for x in range(r + 1, len(array))])
    return result


for line in sys.stdin:
    [a, b, c, d, e, f] = [int(x) for x in line.split()]
    result = Gauss([[a, b, c], [d, e, f]])
    for i in range(len(result) - 1):
        print("{0:.3f}".format(result[i]), end=" ")
    print("{0:.3f}".format(result[-1]))

### FIXED CODE ###

#!/usr/bin/env python3
import sys


def Print(array):
    for r in range(len(array)):
        print(array[r])
    print()


def Gauss(array):
    # for r in range(len(array)):
    #     array[r].append(r)

    for r in range(len(array)):
        # array.sort(key=lambda x: x[r], reverse=True)
        div = array[r][r]
        for c in range(r, len(array) + 1):
            array[r][c] /= div
        for r2 in range(r + 1, len(array)):
            head = array[r2][r]
            for c in range(r, len(array) + 1):
                array[r2][c] -= head * array[r][c]

    result = [0] * len(array)
    for r in range(len(array) - 1, -1, -1):
        result[r] = array[r][
            len(array)] - sum([result[x] * array[r][x] for x in range(r + 1, len(array))])
    return result


for line in sys.stdin:
    [a, b, c, d, e, f] = [int(x) for x in line.split()]
    result = Gauss([[a, b, c], [d, e, f]])
    for i in range(len(result) - 1):
        print("{0:.3f}".format(result[i]), end=" ")
    print("{0:.3f}".format(result[-1]))
N = input()
f = sum(map(int, list(N)))
if N // f == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = input()
f = sum(map(int, list(N)))
if int(N) % f == 0:
  print('Yes')
else:
  print('No')
import math
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

C_count = B // C - A // C
if A % C == 0:
    C_count += 1
D_count = B // D - A // D
if A % D == 0:
    D_count += 1
CD_count = B // lcm(C, D) - A // lcm(C, D)
if A % lcm(C, D) == 0:
    CD_count += 1
div_count = C_count + D_count - CD_count
ans = B - A + 1 - div_count
print(ans)

### FIXED CODE ###

from fractions import gcd
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return (x * y) // gcd(x, y)

C_count = B // C - A // C
if A % C == 0:
    C_count += 1
D_count = B // D - A // D
if A % D == 0:
    D_count += 1
CD_count = B // lcm(C, D) - A // lcm(C, D)
if A % lcm(C, D) == 0:
    CD_count += 1
div_count = C_count + D_count - CD_count
ans = B - A + 1 - div_count
print(ans)
import math
N = int(input())
A = [list(map(int, input().split())) for i in range(N)]

for i in range(N):
  leng = ((A[i][0]) ** 2 + (A[i][1]) ** 2) ** (1/2)
  if (A[i][0] == 0) and (A[i][1] == 0):
    angle = 0
  elif A[i][0] == 0:
    if A[i][1] > 0:
      angle = 90
    else:
      angle = 270
  elif A[i][1] == 0:
    if A[i][0] > 0:
      angle = 0
    else:
      angle = 180
  else:  
    radian = math.atan2(A[i][1], A[i][0])
    angle = math.degrees(radian)
  A[i].append(leng)
  A[i].append(angle)
  
#エンジンは100しかないからN**2でも間に合うはず

ans = 0
for i in range(N):
  x, y = A[i][0], A[i][1]
  for j in range(N):
    angle =A[i][3] 
    if i != j:
      if -90 < angle < 90 :
        if angle - 90 < A[j][3] < angle + 90:
          x += A[j][0]
          y += A[j][1]
      elif -180 < angle < -90:
        if (A[j][3] < angle + 90) or (angle + 270 < A[j][3]):
          x += A[j][0]
          y += A[j][1]
      else: 
        if (angle - 90 < A[j][3]) or (A[j][3] < angle - 270):
          x += A[j][0]
          y += A[j][1]
  ans1 = (x ** 2 + y ** 2 ) ** (1/2)
  ans = max(ans, ans1)
  
print(ans)
#print(A)
   
   
        
      
    
    
 


### FIXED CODE ###

S = str(input())
T = str(input())
count = 0

for i in range(len(S)):
  if S[i] == T[i]:
    count += 1
    
print(count)
n,y=map(int,input().split())
ans=[-1,-1,-1]
for i in range(n+1):
  for j in range(n-i+1):
    if y-10000*i-5000*j==1000*(n-i-j):
      ans=[i,j,n-i-j]
      print(ans[1],ans[2],ans[3])
      exit()
print(ans[1],ans[2],ans[3])

### FIXED CODE ###

n,y=map(int,input().split())
ans=[-1,-1,-1]
for i in range(n+1):
  for j in range(n-i+1):
    if y-10000*i-5000*j==1000*(n-i-j):
      ans=[i,j,n-i-j]
      print(ans[0],ans[1],ans[2])
      exit()
print(ans[0],ans[1],ans[2])
#coding:utf-8
import sys

BAMB_NUM = 0
BAMB_A = 0
BAMB_B = 0
BAMB_C = 0
BAMB_LIST = []

def calcMP(idx, lenA, lenB, lenC):
    """
    calculate MP.
    """
    # when classified all bamboos
    if (idx == BAMB_NUM):
        return abs(lenA - BAMB_A) + abs(lenB - BAMB_B) + abs(lenC - BAMB_C) - 30 if min(lenA, lenB, lenC) > 0 else sys.maxsize
    
    # don't use idx-th bamboo
    mp1 = calcMP(idx + 1, lenA, lenB, lenC)
    # use idx-th bamboo
    mp2 = calcMP(idx + 1, lenA + BAMB_LIST[idx], lenB, lenC) + 10
    mp3 = calcMP(idx + 1, lenA, lenB + BAMB_LIST[idx], lenC) + 10
    mp4 = calcMP(idx + 1, lenA, lenB, lenC + BAMB_LIST[idx]) + 10

    return min(mp1, mp2, mp3, mp4)

if __name__ == "__main__":
    """
    http://drken1215.hatenablog.com/entry/2019/02/24/224100
    """
    # requested bamboo lengths
    BAMB_NUM, BAMB_A, BAMB_B, BAMB_C = map(lambda x: int(x), input().split())
    # available bamboo lengths
    for bamb in range(BAMB_NUM):
        BAMB_LIST.append(int(input()))

    mp = calcMP(0, 0, 0, 0)
    print(mp)

### FIXED CODE ###

#coding:utf-8

if __name__ == "__main__":
    date = input()
    year, month, day = date.split("/")

    if int(year) <= 2019:
        if int(month) <= 4:
            if int(day) <= 30:
                print("Heisei")
                exit()
    
    print("TBD")
N, M = map(int, input().split())
ps = [input().split() for _ in range(M)]

correct = [0] * N
penalty = [0] * N
for p, s in ps:
    p = int(p)
    if correct[p-1] == 1:
        continue
    if s == 'AC':
        correct[p-1] = 1
    else:
        penalty[p-1] += 1
print(sum(correct), sum([p*c for p, c in zip(penalty, correct)]))))



### FIXED CODE ###

N, M = map(int, input().split())
ps = [input().split() for _ in range(M)]

correct = [0] * N
penalty = [0] * N
for p, s in ps:
    p = int(p)
    if correct[p-1] == 1:
        continue
    if s == 'AC':
        correct[p-1] = 1
    else:
        penalty[p-1] += 1
print(sum(correct), sum([p*c for p, c in zip(penalty, correct)]))
input()
K = int(raw_input())
s_list = list(s)
for i in range(len(s_list)):
    # how long does it take to force a
    lag = ord('z') - ord(s_list[i]) + 1
    if s_list[i] != 'a' and K >= lag and i < len(s_list) - 1:
        # not a and can conv
        s_list[i] = 'a'
        K -= lag
    elif i == len(s_list) - 1:
        s_list[i] = chr(ord('a') + ((ord(s_list[i]) - ord('a') + K) % 26))
print "".join(s_list)


### FIXED CODE ###

# -*- coding: utf-8 -*-
raw = raw_input()

ans =  raw[:4]+' '+raw[4:]

print ans
n, k = map(int, input().split())
import math

if k == 1:
    print(0)
else:
    print(math.gcd(n, k))


### FIXED CODE ###

n, k = map(int, input().split())
import math

if k == 1:
    print(0)
elif n < k:
    print(min(abs(n-k), abs(n)))
else:
    num = n // k
    n = n - num * k
    print(min(n, abs(n-k)))
#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Node(object):

  def __init__(self, idx):
    self.idx = idx
    self.supply = 300
    self.remain = 0
    self.edges = []

  def __hash__(self):
    return self.idx


def main():
  n, m, tank = map(int, input().split())
  nodes = [Node(i) for i in range(n)]
  results = []

  for _ in range(m):
    a, b, c = map(int, input().split())
    nodes[a - 1].edges.append((nodes[b - 1], c))
    nodes[b - 1].edges.append((nodes[a - 1], c))

  for _ in range(int(input())):
    start, end = map(int, input().split())
    start -= 1
    end -= 1

    for n in nodes:
      n.supply = 300
      n.remain = 0

    result = -1
    nodes[start].supply = 0
    nodes[start].remain = tank
    currents = set([nodes[start]])

    while len(currents) != 0:
      n = min(currents)
      currents.remove(n)

      if n.idx == end:
        result = n.supply
        break

      for e, d in n.edges:
        if d > tank:
          continue
        elif d > n.remain:
          remain = tank - d
          supply = n.supply + 1
        else:
          remain = n.remain - d
          supply = n.supply

        if e.supply > supply or n.remain < remain:
          e.supply = supply
          e.remain = remain
          currents.add(e)

    results.append(result)

  for r in results:
    print(r)


if __name__ == '__main__':
  main()



### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Node(object):

  def __init__(self):
    self.fixed = False
    self.supply = 300
    self.tank = 0
    self.edges = []

  def __repr__(self):
    return str(self)

  def __str__(self):
    return '{}/{}({})'.format(self.supply, self.tank, int(self.fixed))


def main():
  n, m, tank = map(int, input().split())
  nodes = [Node() for _ in range(n)]

  for _ in range(m):
    a, b, c = map(int, input().split())

    nodes[a - 1].edges.append((nodes[b - 1], c))
    nodes[b - 1].edges.append((nodes[a - 1], c))

  queries = [list(map(int, input().split())) for _ in range(int(input()))]
  results = [[None] * len(nodes) for _ in range(len(nodes))]

  for start in range(len(nodes)):
    for node in nodes:
      node.fixed = False
      node.supply = 300
      node.tank = 0

    nodes[start].supply = 0
    nodes[start].tank = tank

    while True:
      targets = [n for n in nodes if not n.fixed ]

      if len(targets) == 0:
        break

      target = min(targets, key=lambda n: (n.supply, -n.tank))
      target.fixed = True

      for n, d in target.edges:
        if n.fixed or d > tank:
          continue

        if d > target.tank:
          new_supply = target.supply + 1
          new_tank = tank - d
        else:
          new_supply = target.supply
          new_tank = target.tank - d

        if (new_supply, -new_tank) < (n.supply, -n.tank):
          n.supply = new_supply
          n.tank = new_tank

    for end in range(len(nodes)):
      results[start][end] = nodes[end].supply

  for start, end in queries:
    if results[start - 1][end - 1] == 300:
      print(-1)
    else:
      print(results[start - 1][end - 1])


if __name__ == '__main__':
  main()
import sys
n=int(input())
L=[]
for i in range(1,int(n**(1/2))):
    if n//i == n/i:
        L.append(n//i+i-2)
print(min(L))

### FIXED CODE ###

import sys
n=int(input())
L=[]
for i in range(1,int(n**(1/2))+1):
    if n//i == n/i:
        L.append(n//i+i-2)
print(min(L))
N=int(input())
L=[input() for i range(N)]
M=sorted(L)
print(len(M))

### FIXED CODE ###

N=int(input())
S=[input() for i in range (N)]
L=list(S)
M=list(set(L))
j=len(M)
print(j)
N = int(input())
L = []
for i in range(N):
  P = int(input())
  L.append(P)

#フラグ
F = 0

#答え
A = 0

for i in range(N):
  for j in range(1, i):
    if L[j] < L[i]:
      F = 0
      break
    else:
      F = 1
  if(F == 1):
    A += 1

print(A+1)

### FIXED CODE ###

N = int(input())
d = list(map(int, input().split()))

c = 1
a = d[0]

for i in range(1,N):
  if d[i] <= a:
    c += 1
    a = d[i]

print(c)
[a,b] = int(input(),split())
 if a > b:
  print( a > b)
 elif a < b:
  print( a < b )
 else:
  print( a == b )

### FIXED CODE ###

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

if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
N=int(input())
A=list(map(str, input().split()))
counter=0
if 'P', 'W', 'G', 'Y' in A:
  print('Four')
else:
  print('Three')

### FIXED CODE ###

N=int(input())
A=list(map(str, input().split()))
color=['P','W','G','Y']
counter=0
for i in color:
  if i in A:
    counter+=1
if counter==4:
  print('Four')
else:
  print('Three')
n = 0
list = []
while n < 10:
    x = input()
    list.append(x)
    n += 1

sort.list()
print(list[7])
print(list[8])
print(list[9])

### FIXED CODE ###

n = 0
list = []
while n < 10:
    x = int(input())
    list.append(x)
    n += 1

list.sort()
print(list[9])
print(list[8])
print(list[7])
n = int(input().split())

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

flag == True

for i in range(n):
  if a[i]%2 == 0:
    if a[i]%3 != 0 or a[i]%5 != 0:
      print('DENIED')
      flag = False
      break
      
if flag:
  print('APPROVED')


### FIXED CODE ###

n = int(input())

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

flag = True

for i in range(n):
  if a[i]%2 == 0:
    if a[i]%3 != 0 and a[i]%5 != 0:
      print('DENIED')
      flag = False
      break
      
if flag:
  print('APPROVED')
N, M = map(int, input().split())
E = []
for i in range(M):
    a, b = map(int, input().split())
    E.append((a-1, b-1))

tree = {n: n for n in range(N)}
child = {n: 1 for n in range(N)}

max_connection = N*(N-1)//2


def find_head(i):
    if tree[i] != i:
        return find_head(tree[i])
    else:
        return i


connection = 0
out_list = [max_connection]
for e in E[:0:-1]:
    head_e0 = find_head(e[0])
    head_e1 = find_head(e[1])

    if head_e0 == head_e1:
        out_list.append(max_connection-connection)
    else:
        tree[head_e1] = head_e0
        connection = connection + child[head_e0]*child[head_e1]
        child[head_e0] += child[head_e1]
        out_list.append(max_connection - connection)
    if max_connection == connection:
        break

if len(out_list) != M:
    out_list += [0]*(M-len(out_list))

for o in out_list[::-1]:
    print(o)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
E = []
for i in range(M):
    a, b = map(int, input().split())
    E.append((a-1, b-1))

tree = {n: n for n in range(N)}
child = {n: 1 for n in range(N)}

max_connection = N*(N-1)//2


def find_head(i):
    if tree[i] != i:
        tree[i] = find_head(tree[i])
        return tree[i]
    else:
        return i


connection = 0
out_list = [max_connection]
for e in E[:0:-1]:
    head_e0 = find_head(e[0])
    head_e1 = find_head(e[1])

    if head_e0 == head_e1:
        out_list.append(max_connection-connection)
    else:
        tree[head_e1] = head_e0
        connection = connection + child[head_e0]*child[head_e1]
        child[head_e0] += child[head_e1]
        out_list.append(max_connection - connection)
    if max_connection == connection:
        break

if len(out_list) != M:
    out_list += [0]*(M-len(out_list))

for o in out_list[::-1]:
    print(o)
a,b = input().split()
a1 = int(a)
b1 = int(b*100)
print((a1*b1)//100)

### FIXED CODE ###

a,b = input().split()
a1 = int(a)
b1 = int(b[0] + b[2] + b[3])
print(a1*b1//100)
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 1000000007

last_ana = int(input())
blocks = [last_ana]

for _ in range(1, m):
    ana = int(input())
    blocks.append(ana - last_ana - 1)
    last_ana = ana

blocks.append(n - last_ana)

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)

    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % 1000000007)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans *= c[num - 1]
        if ans >= BIGNUM:
            ans = ans % BIGNUM
        if ans == 0:
            break

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

if m > 0:
    last_ana = int(input())
    blocks = [last_ana]

    for _ in range(1, m):
        ana = int(input())
        blocks.append(ana - last_ana - 1)
        last_ana = ana
    blocks.append(n - last_ana)
else:
    blocks = [n + 1]

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)
    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)
N=str(input())
a=int(N[0])
b=int(N[1])
c=int(N[2])
d=int(N[3])
for i in range(2):
  for j in range(2):
    for k in range(2):
      t=a
      if i==0:
        t+=b
      else:
        t-=b
        
      if j==0:
        t+=c
      else:
        t-=c
        
      if k==0:
        t+=d
      else:
        t-=d
        
      if t==7:
        print(f"{a}{"+-"[i]}{b}{"+-"[j]}{c}{"+-"[k]}{d}=7")
  
        
  

### FIXED CODE ###

N=str(input())
a=int(N[0])
b=int(N[1])
c=int(N[2])
d=int(N[3])
for i in range(2):
  for j in range(2):
    for k in range(2):
      t=a
      if i==0:
        t+=b
      else:
        t-=b
        
      if j==0:
        t+=c
      else:
        t-=c
        
      if k==0:
        t+=d
      else:
        t-=d
        
      if t==7:
        print("{}{}{}{}{}{}{}=7".format(a,"+-"[i],b,"+-"[j],c,"+-"[k],d))
        exit()
N = int(input())
l = list(map(int, input().split()))

cnt = 0
for i in range(0, len(l), 2):
  if l[i] % 2 != 0:
    cnt += 1

print(cnt)

### FIXED CODE ###

L, R, d = map(int, input().split())
  
cnt = 0
for i in range(L, R+1, 1):
  if i % d == 0:
    cnt += 1

print(cnt)
N,K = map(int, input().split())
sum = 0
while N!=0:
    N = N//K
    sum+=1
print(sum)





### FIXED CODE ###

N, R = map(int, input().split())
if N > 10:
  print(R)
else :
  print(100 * (10 - N) + R)
n,k = map(int, input().split())
ans = 2*k+1
if ans > n:
  print(‘NO’)
else:
  print(‘YES’)

### FIXED CODE ###

n,k = map(int, input().split())
ans = 2*k-1
if n < ans:
  print('NO')
else:
  print('YES')
N = int(input())
A = list(map(int, input().split()))

A.sort()

for i in range(N - 1):
    if A[i] == A[i + 1]:
        print('NO')
        return

print('YES')


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

A.sort()

for i in range(N - 1):
    if A[i] == A[i + 1]:
        print('NO')
        break
else:
    print('YES')
import numpy as np
import sys

flag = True
while (flag):
	input_line = sys.stdin.readline()
    if not input_line:
      break

    input_line[0:3] = '2018'
	print(input_line)

### FIXED CODE ###

s = str(input())
print("2018" + s[4:])
n=int(input())
a=[]
for i in range(n):
    A=int(input())
    a.append(A)
l=deque([a[0]])
for i in range(1,n):
    if l[0]>=a[i]:
        l.appendleft(a[i])
    elif l[-1]<=a[i]:
        l.append(a[i])
    else:
        p=0
        q=len(l)-1
        while q-p!=1:
            if l[(p+q)//2]>=a[i]:
                q=(p+q)//2
            else:
                p=(p+q)//2
        l[p]=a[i]
print(len(l))

### FIXED CODE ###


from collections import deque

n=int(input())
a=[]
for i in range(n):
    A=int(input())
    a.append(A)
l=deque([a[0]])
for i in range(1,n):
    if l[0]>=a[i]:
        l.appendleft(a[i])
    elif l[-1]<a[i]:
        l[-1]=a[i]
    else:
        p=0
        q=len(l)-1
        while q-p!=1:
            if l[(p+q)//2]>=a[i]:
                q=(p+q)//2
            else:
                p=(p+q)//2
        l[p]=a[i]
print(len(l))
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
a = len(filter(lambda x: x<=A,P))
b = len(filter(lambda x: A<x<=B,P))
c = len(filter(lambda x: B<x,P))
print(min(a,b,c))

### FIXED CODE ###

N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
a = len([*filter(lambda x: x<=A,P)])
b = len([*filter(lambda x: A<x<=B,P)])
c = len([*filter(lambda x: B<x,P)])
print(min(a,b,c))
D = int(input())
T = int(input())
S = int(input())

if(D/S<=T):
  print('Yes')
  
else:
  print('No')

### FIXED CODE ###

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

if(i[0]/i[2]<=i[1]):
  print('Yes')
  
else:
  print('No')
print(str(input().split(',',' ')))


### FIXED CODE ###

print(input().replace(',', ' '))
H,W = map(int,input().split())
l = [list(input()) for i in range(H)]
#print(H,W,l)

w_del = []
h_del = []
for i in range(W):
    flag = 0
    for j in range(H):
        if l[j][i] == "#":
            flag = 1
    if flag == 0:
        w_del.append(i)
for x in w_del:
    for i in range(H):
        del l[i][x]

W = len(l[0])
for i in range(H):
    flag = 0
    for j in range(W):
        if l[i][j] == "#":
            flag = 1
    if flag == 0:
        h_del.append(i)
for x in h_del:
    del l[x]

for i in l:
    for x in i:
        print(x,end="")
    print()

### FIXED CODE ###

H,W = map(int,input().split())
l = [list(input()) for i in range(H)]
#print(H,W,l)


wlist = []
hlist = []
harray = []
for i in range(H):
    flag = 0
    for j in range(W):
        if l[i][j] == "#":
            flag = 1
    if flag == 1:
        hlist.append(i)
for i in hlist:
    harray.append(l[i])
H = len(harray)

for i in range(W):
    flag = 0
    for j in range(H):
        if harray[j][i] == "#":
            flag = 1
    if flag == 0:
        wlist.append(i)
for i in wlist:
    for j in range(H):
        harray[j][i] = "n"

for i in harray:
    for x in i:
        if x != "n":
            print(x,end="")
    print()
# encoding:utf-8
import math as ma
# math.pi
x = int(input())

pi = (x * x) * ma.pi
# Circumference
pi_line = x  * ma.pi

print("{0:f} {1:f}".format(pi,pi_line))

### FIXED CODE ###

# encoding:utf-8
import math as ma
# math.pi
x = float(input())

pi = (x * x) * ma.pi
# Circumference
pi_line = (x + x) * ma.pi

print("{0} {1}".format(pi,pi_line))
def getAbs(L):
  return list(map(abs, L))

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

stop = min(getAbs(a))
while min(a) != stop*(-1):
  if a == getAbs(a):
    break
  i = a.index(min(a))
  j = i + 1
  a[i] = a[i] * (-1)
  a[j] = a[j] * (-1)
print(sum(a))

### FIXED CODE ###

def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)
import sys

stdin = sys.stdin

mod = 1000000007

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

from collections import defaultdict

n = ni()
a = na()

d = defaultdict(int)
b = defaultdict(int)

for i in range(1, n + 1):
	if i % 2 == 0:
		d[a[i - 1]] += 1
	else:
		b[a[i - 1]] += 1

d_mkey, d_mval = [0] * 2
b_mkey, b_mval = [0] * 2

for k, v in d.items():
	if d_mval < v:
		d_mkey = k
		d_mval = v

for k, v in b.items():
	if b_mval < v:
		b_mkey = k
		b_mval = v

if d_mkey != b_mkey:
	print(n - d_mval - b_mval)
else:
	p = list(d.values())
	q = list(b.values())
	p.sort()
	q.sort()
	pv = p[len(p) - 2]
	qv = p[len(q) - 2]
	if pv <= qv:
		print((n - d_mval) + (n // 2 - qv))
	else:
		print((n - b_mval) + (n // 2 - pv))


### FIXED CODE ###

import sys

stdin = sys.stdin

mod = 1000000007
inf = 1 << 60

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

from collections import Counter
from itertools import product

n = ni()
a = na()

even = Counter(a[::2])
odd = Counter(a[1::2])

even[-1] = 0
odd[-2] = 0

e = even.most_common(2)
o = odd.most_common(2)

ans = n
for (k1, v1), (k2, v2) in product(e, o):
    if k1 == k2:
        continue
    x = (n - v1 - v2)
    if ans > x:
        ans = x

print(ans)