Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
A = []
for i in range(A):
  A.append(int(input()))

dp = [0] * (N+1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1
div = 1000000007

for i in range(2,N+1):
  if (dp[i-1] == 0) & (dp[i-2]==0):
    print(dp)
    print(0)
    sys.exit()
  elif i in A:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[N])

### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

A = set(A)
dp = [0] * (N+1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1
mod = 1000000007

for i in range(2,N+1):
  if (dp[i-1] == 0) & (dp[i-2]==0):
    print(0)
    exit()
  elif i in A:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[N]%mod)
N,M=map(int,input().split())
ans=[-1]*N
flag=True
sc = [map(int, input().split()) for _ in range(M)]
s, c = [list(i) for i in zip(*sc)]
x=0
for i in range(M):
  s1=s[i]
  c1=c[i]
  if(ans[s1-1]==-1):
    ans[s1-1]=c1
  elif(ans[s1-1]!=c1):
    flag=False
  if(N>1 and c1==0):
    flag=False
if(flag==False):
  print("-1")
else:
  for i in range(N):
    if(N==1):
      if(ans[i]==-1):
        ans[i]=0
    else:
      if(i==0 and ans[i]==-1):
        ans[i]=1
      elif(ans[i]==-1):
        ans[i]=0
  for j in range(N):
    x+=ans[j]*(10**(N-j-1))
  print(x)

### FIXED CODE ###

N,M=map(int,input().split())
ans=[-1]*N
flag=True
s=[]
c=[]
for i in range(M):
  s1,c1=map(int,input().split())
  s.append(s1)
  c.append(c1)
#sc = [map(int, input().split()) for _ in range(M)]
#s, c = [list(i) for i in zip(*sc)]
x=0
for i in range(M):
  s1=s[i]
  c1=c[i]
  if(ans[s1-1]==-1):
    ans[s1-1]=c1
  elif(ans[s1-1]!=c1):
    flag=False
  if(N>1 and s1==1 and c1==0):
    flag=False
if(flag==False):
  print("-1")
else:
  for i in range(N):
    if(N==1):
      if(ans[i]==-1):
        ans[i]=0
    else:
      if(i==0 and ans[i]==-1):
        ans[i]=1
      elif(ans[i]==-1):
        ans[i]=0
  for j in range(N):
    x+=ans[j]*(10**(N-j-1))
  print(x)
def main():
    
    #0 input
    N = int(input())
    LR = []
    for i in range(N):
        LR.append(list(map(int, input().split())))
    

    
    LR_sorted_tmp = sorted(LR, reverse=False)
    LR_sorted = []
    for part in LR_sorted_tmp:
        if part[0] > 0:
            LR_sorted.append(part)

    LR_sorted_R = sorted(LR, key=lambda x:x[1], reverse=True)
    LR_sorted_R_tmp = []
    for part in LR_sorted_R_tmp:
        if part[0] < 0:
            LR_sorted_R.append(part)
    
    takahashi = 0
    moved = 0

    while 1:
        #1 choose maximum L
        next_interval  = LR_sorted[-1]
        
        # finish if Takahashi is in the next interval
        if next_interval[0] <= takahashi and takahashi <= next_interval[1]:
            break
        
        moved += next_interval[0] - takahashi
        takahashi = next_interval[0]
        
        # delete the current interval
        del LR_sorted[-1]

        # finish if no items in the list
        if len(LR_sorted) == 0:
            break


        
        #2 choose minimum R      
        next_interval = LR_sorted_R[-1]
        
        # finish if Takahashi is in the next interval
        if next_interval[0] <= takahashi and takahashi <= next_interval[1]:
            break
        
        moved += takahashi - next_interval[1]
        takahashi = next_interval[1]
        
        # delete the current interval
        del LR_sorted_R[-1]


        # finish if no items in the list
        if len(LR_sorted) == 0:
            break
        
        
    moved += abs(0-takahashi)
    print(moved)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
left = []
right = []
for _ in range(n):
    l,r = li()
    left.append(l)
    right.append(r)
    
left.sort(reverse=True)
right.sort(reverse=False)

ans_l = 0
last = 0
for i in range(n):
    if left[i] - last < 0:
        ans_l += abs(last)
        break
    else:
        ans_l += (left[i] - last) 
        last = left[i]
    
    if last - right[i] < 0:
        ans_l += abs(last)
        break
    else:
        ans_l += (last - right[i])
        last = right[i]
    
ans_r = 0
last = 0
for i in range(n):
    if last - right[i] < 0:
        ans_r += abs(last)
        break
    else:
        ans_r += (last - right[i])
        last = right[i]
    
    if left[i] - last < 0:
        ans_r += abs(last)
        break
    else:
        ans_r += (left[i] - last) 
        last = left[i]
    


print(max(ans_l, ans_r))
5
CHOKUDAI
RNG
MAKOTO
AOKI
RINGO

### FIXED CODE ###

import collections
N = int(input())
S = [input() for i in range(N)]
SI = [S[i][0] for i in range(N)]
cnt = collections.Counter(SI)
n = [cnt["M"],cnt["A"],cnt["R"],cnt["C"],cnt["H"]]
ans = 0
for i in range(3):
    for j in range(i+1,5):
        for k in range(j+1,5):
            ans += n[i]*n[j]*n[k]
print(ans)
def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,0
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            while (B_sum_arr[j] <= (K - A_sum_arr[i])) and (j < len(B_sum_arr)):
                j += 1
            j -= 1
        count = max(count,(i+j))
    return count

if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    print(get_max_book_num(A,B,K))
    


### FIXED CODE ###

def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr

def get_max_b(left_time,j,B_sum_arr):
    # [0,1,2,3,4,5]
    while B_sum_arr[j] > left_time and j > 0:
        j -= 1
    return j
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,len(B_sum_arr)-1
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            left_time = K - A_sum_arr[i]
            j = get_max_b(left_time,j,B_sum_arr)
        count = max(count,(i+j))
    return count
if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    print(get_max_book_num(A,B,K))
n = int(input())
a = list(map(int,input().split()))

a_sort = list(reversed(list(sorted(a))))
amax = max(a_sort)

if a_sort.count(amax) >3:
    print(amax ** 2)
    
else:
    one = 0
    two = 0
    for i in a_sort:
        if a_sort.count(i) > 1 and one = 0 and two = 0:
            one = i
        elif a_sort.count(i) > 1 and one > 0 and two = 0:
            two = i
        else:
            break
    print(one*two)
    


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
Adict = {}
for i in A:
    if i in Adict:
        Adict[i]=Adict[i]+1
    else:
        Adict.update({i:1})
B = [0, 0]
for i in Adict.keys():
    if Adict[i] >= 2:
        B.append(i)
    if Adict[i] >= 4:
        B.append(i)
B.sort()
print(B[-1]*B[-2])
n = map(int, input().split())
print((max(n)*3-sum(n))/2 if (sum(n)+max(n))%2 == 0 else ((max(n)+1)*3-sum(n))/2)


### FIXED CODE ###

n = list(map(int, input().split()))
print((max(n)*3-sum(n))//2 if (max(n) + sum(n)) % 2 == 0 else ((max(n)+1)*3-sum(n))//2)
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #ここにコード
    #input
    N, M, K = map(int, input().split())

    #output
    mod = 998244353

    n_ = 4*10**5 + 5
    fun = [1]*(n_+1)
    for i in range(1,n_+1):
        fun[i] = fun[i-1]*i%mod
    rev = [1]*(n_+1)
    rev[n_] = pow(fun[n_],mod-2,mod)
    for i in range(n_-1,0,-1):
        rev[i] = rev[i+1]*(i+1)%mod
    def cmb(n,r):
        if n <= 0 or r < 0 or r > n: return 0
        return fun[n]*rev[r]%mod*rev[n-r]%mod

    answer = 0
    for i in range(K+1):
        answer += M*pow(M-1, N-(i+1), mod)*cmb(N-1, i) % mod

    answer %= mod

    if N == 1:
        answer = M
    else:
        continue

    print(answer)
    

if __name__ == "__main__":
    main()

### FIXED CODE ###

#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #ここにコード
    #input
    N, M, K = map(int, input().split())

    #output
    mod = 998244353

    n_ = 4*10**5 + 5
    fun = [1]*(n_+1)
    for i in range(1,n_+1):
        fun[i] = fun[i-1]*i%mod
    rev = [1]*(n_+1)
    rev[n_] = pow(fun[n_],mod-2,mod)
    for i in range(n_-1,0,-1):
        rev[i] = rev[i+1]*(i+1)%mod
    def cmb(n,r):
        if n <= 0 or r < 0 or r > n: return 0
        return fun[n]*rev[r]%mod*rev[n-r]%mod

    answer = 0
    for i in range(K+1):
        answer += M*pow(M-1, N-(i+1), mod)*cmb(N-1, i) % mod

    answer %= mod

    if N == 1:
        print(M)
        exit()

    print(answer)
    

if __name__ == "__main__":
    main()
while True:
    m, f, r = [int(i) for i in input().split]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')

    elif total < 50 and r < 50:
        print('D')

    elif total < 65:
        print('C')

    elif total < 80:
        print('B')

    else:
        print('A')

### FIXED CODE ###

while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
 
    else:
        print('A')
N =int(input())
A = list(map(int, input().split()))

def judge(A):
    
    count = 0
    for i in range(N):
        if A[i] >= 1:
            count += 1
    if count == 1:
        return 1
    else: return 0
    

while judge(A) == 0:
    A.sort()

    for i in range(N):
        if i >=1:
            A[i] = A[i]%A[0]

for i in range(N):
    if A[i] >= 1:
        print(A[i])

### FIXED CODE ###

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

#２整数の最大公約数を求める

def gcd2(x,y): 
    while y != 0:
        x , y = y , x % y 
    return x



#N 整数の最大公約数を求める
#A = [A[0],...,A[N]] とする

def gcd(A):
    ans = A[0]
    for i in range(1,N): #range(1,N)= 1,2,...,N-1
        ans = gcd2(ans, A[i])
    return ans
print(gcd(A))
import numpy


N, D = (int(i) for i in input().split())
X = [[int(i) for i in input().split()] for i in range(N)]
print([D, N])
print(X)

a = numpy.array(X[0])
b = numpy.array(X[1])
u = b - z
print(numpy.linalg.norm(u))

### FIXED CODE ###

import math as ma

def dist(a, b, D):
  r = 0
  for i in range(D):
    r = r + (a[i]-b[i])**2

  return ma.sqrt(r)

N, D = (int(i) for i in input().split())
X = [[int(i) for i in input().split()] for i in range(N)]

ret = 0
for i in range(N):
  for j in range(i+1, N):
    d = dist(X[i], X[j], D)
    if (d == int(d)):
      ret = ret + 1

print(ret)
import sys
import random
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

import math
A, B, N = MII_split()

def f(x):
    """最小値を求めたい関数"""
    return math.floor(A * x / B) - A * math.floor(x / B)

def numerical_diff(f, x):
    """中央差分を元に数値微分する関数"""
    h = 1e-4
    return (f(x + h) - f(x - h)) / (2 * h)

def gradient_descent(f, initial, learning_rate=1, steps=10**2):
    """一階導関数から勾配法で最小値を求める関数"""
    # 現在地を示すカーソル
    x = initial

    # 所定の回数を繰り返す
    for _ in range(steps):
        # 現在地の勾配 (どちらにどれだけ進むべきか) を得る
        grad = numerical_diff(f, x)
        # 勾配を元にして現在地を移動する
        x -= learning_rate * grad

    # 最終的な位置を返す
    return f(x)

ma = 0
for _ in range(N/2):
    ini = random.randrange(N + 1)
    tmp = gradient_descent(f, ini)
    # tmp = f(ini)
    if ma < tmp:
        ma = tmp


print(ma)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

import math

A, B, N = MII_split()

def f(x):
    return math.floor(A * x / B) - A * math.floor(x / B)

# max = 0
# for x in range(min(B + 1, N + 1)):
#     if x > N:
#         break
#     fx = f(x)
#     # print(fx)
#     if fx > max:
#         max = fx
print(f(min(B-1, N)))
a,b,c,d,e,f=map(int,input().split())
a,b=a*100,b*100

DP=[-1 for _ in range(f+2)]
DP[a],DP[b]=0,0
for i in range(f+1):
    if DP[i]==-1:continue
    for j in a,b:
        if i+j<=f:DP[i+j]=DP[i]
    for j in c,d:
        if i+j<=f and 100*(DP[i]+j)/(i+j)<=100*e/(100+e):
            DP[i+j]=DP[i]+j

ans,water=0,[a,0]
for i,j in enumerate(DP):
    if i==0:continue
    if ans<100*j/i:
        ans=100*j/i
        water=[i,j]
print(*water)

### FIXED CODE ###

inf=10**8
a,b,c,d,e,f=map(int,input().split())
a,b=100*a,100*b
DP=[inf]*(f+max(a,b)+1)
DP[a],DP[b]=0,0

for i in range(f+1):
    if DP[i]!=inf:
        DP[i+a]=DP[i]
        DP[i+b]=DP[i]
        for j in c,d:
            if 100*(DP[i]+j)/(i+j)<=100*e/(100+e):
                DP[i+j]=max(DP[i],DP[i]+j)

ans,index=0,[a,0]
for i in range(f+1):
    if DP[i]!=inf:
        if ans<100*DP[i]/i:
            ans=100*DP[i]/i
            index=[i,DP[i]]

print(*index)
import numpy

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

K = A[1]
N = A[0]

P = list(map(float, input().split()))

EP = list(map(lambda x: (1+x)/2, P))

cumEP = list(numpy.cumsum(EP))

new_list = []
for val in range(N-K):
    new_list.append(cumEP[val+K]-cumEP[val])

print(max(new_list))


### FIXED CODE ###

import numpy

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

K = A[1]
N = A[0]

P = list(map(float, input().split()))

EP = list(map(lambda x: (1+x)/2, P))

cumEP = list(numpy.cumsum(EP))

new_list = []

if N>K:
    for val in range(N-K):
        new_list.append(cumEP[val+K]-cumEP[val])
    print(max(new_list))
else:
    print(sum(EP))
n,m=map(int,input().split())
WA,wa,ac=0,0,0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if i>0 and p!=before:
        wa=0
    if s=="WA":
        wa+=1
    elif s=="AC" and p==before:
        WA+=wa
        ac+=1
    before=p
print(ac,WA)

### FIXED CODE ###

n,m=map(int,input().split())
acs=[0]*n
was=[0]*n
WA=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if acs[p-1]==0:
        if s=="AC":
            acs[p-1]=1
            WA+=was[p-1]
        else:
            was[p-1]+=1
print(sum(acs),WA)
S = input()

def solve(S):
    if S[4] == S[5] and S[6] == S[7]:
        return "Yes"
    else:
        return "No"

print(solve(S))

### FIXED CODE ###

S = input()

def solve(S):
    if S[2] == S[3] and S[4] == S[5]:
        return "Yes"
    else:
        return "No"

print(solve(S))
s = input()
n = len("s")
X = x*n
print("X")

### FIXED CODE ###

s = input()
n = len(s)
X = "x" *n
print(X)
S=list(map(int, input().split()))
if S=='ARC':
  print("ABC")
else:
  print("ARC")

### FIXED CODE ###

S=input()
if S=="ARC":
  print("ABC")
else:
  print("ARC")
x=0
A,B,K = input().split()
while (int(A)>0):
  x=int(x)+1
  A=int(A)-1
  if(x>int(K)):
    break
while (int(B)>0):
  x=int(x)+1
  B=int(B)-1
  if(x>int(K)):
    break
if(A>0):
  A=int(A)+1
if(B>0):
  B=int(B)+1
print(format(A)+' '+format(B))

### FIXED CODE ###

S,T = input().split()
print (T+S)
N,M = [int(i) for i in input().split()]

groups = []

for i in range(M):
    a,b = [int(i) for i in input().split()]
    flag = True
    for j,g in enumerate(groups):
        if a in g or b in g:
            groups[j] = np.unique(np.append(g,[a,b]))
            flag = False
    if flag:
        groups.append([a,b])
        

maxMember = 0
for g in groups:
    maxMember = max(maxMember,len(g))

print(maxMember)

### FIXED CODE ###

import numpy as np

class union_find:
    def __init__(self,N):
        self.r = np.ones(N)*-1
    
    def root(self,x):
        if self.r[x]<0:
            return int(x)
        else:
            self.r[x] = self.root(int(self.r[x]))
            return int(self.r[x])
        
    def unite(self,x,y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        else:
            self.r[x] += self.r[y]
            self.r[y] = int(x)
            return True
        
    def size(self,x):
        return -self.r[self.root(x)]


N,M = [int(i) for i in input().split()]

Union = union_find(N)
for i in range(M):
    x,y = [int(i) for i in input().split()]
    Union.unite(x-1,y-1)

Y = - min(Union.r)
print(int(Y))
from decimal import *
from math import *

getcontext().prec = 1000
a, b, c = map(int, input().split())

print("Yes" if Decimal(a) ** 0.5 + Decimal(b) ** 0.5 < Decimal(c) ** 0.5 else "No")

### FIXED CODE ###

from decimal import *
a, b, c = map(int, input().split())

print("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")
n=int(input())
F= [list(map(int,input().split())) for i in range(N)]
#F[i][j]はi行目、すなわち店i+1の時間帯jに対してやっているかどうか
P= [list(map(int,input().split())) for i in range(N)]
#P[i][j]は店i+1が時間jに1で自分も1の時に得られる効果
ans=[]
for k in range(n):
    for i in range(2**10):
        c=0
        for j in range(10):
            if (i>>j)&1 and F[k][j]==1:
                c+=P[k][j]
        ans.append(c)
print(max(c))

### FIXED CODE ###

n = int(input())
F = [int("".join(input().split()), 2) for _ in range(n)]
P = [list(map(int, input().split())) for _ in range(n)]
num = 1 << 10
ans = -(10 ** 10)


def popcnt(n):
    c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)
    c = (c & 0x0F0F0F0F0F0F0F0F) + ((c >> 4) & 0x0F0F0F0F0F0F0F0F)
    c = (c & 0x00FF00FF00FF00FF) + ((c >> 8) & 0x00FF00FF00FF00FF)
    c = (c & 0x0000FFFF0000FFFF) + ((c >> 16) & 0x0000FFFF0000FFFF)
    c = (c & 0x00000000FFFFFFFF) + ((c >> 32) & 0x00000000FFFFFFFF)
    return c


# print(F)

for i in range(1, num):
    temp = 0
    for j in range(n):
        temp += P[j][popcnt(i & F[j])]
    ans = max(temp, ans)
print(ans)
N = int(raw_input())
A = [int(i) for i in raw_input().split()]

A0 = [A[i] for i in xrange(0, N, 2)]
A1 = [A[i] for i in xrange(1, N, 2)]

Count = 0
S0 = set(A0)
S1 = set(A1)
N0 = []
N1 = []

for s in S0:
    N0.append((s, sum(map(lambda x: x==s, A0))))

for s in S1:
    N1.append((s, sum(map(lambda x: x==s, A1))))

N0.sort(key=lambda x: x[1], reverse=True)
N1.sort(key=lambda x: x[1], reverse=True)

if N0[0][0] == N1[0][0]:
    if N0[0][0] < N1[0][0]:
        if len(N0) == 1:
            print N - N1[0][1]
        else:
            print N - N0[1][1] - N1[0][1]
    else:
        if len(N1) == 1:
            print N - N0[0][1]
        else:
            print N - N0[0][1] - N1[1][1]
else:
    print N - N0[

### FIXED CODE ###


from collections import Counter

n    = int(raw_input())
nums = list(map(int, raw_input().split()))

nums_odd  =   nums[0:n:2]
nums_even =   nums[1:n:2]

N_odd     =   sorted(Counter(nums_odd ).items(), key=lambda x: x[1], reverse=True) + [(-1,0)]
N_even    =   sorted(Counter(nums_even).items(), key=lambda x: x[1], reverse=True) + [(-1,0)]

if N_odd[0][0] == N_even[0][0]:
    if N_odd[0][1] + N_even[1][1] > N_odd[1][1] + N_even[0][1]:
        print n - N_odd[0][1] - N_even[1][1]
    else:
        print n - N_odd[1][1] - N_even[0][1]
else:
    print n - N_odd[0][1] - N_even[0][1]
from functools import lru_cache
MOD = 1000_000_007

def valid(s):
    f = 0
    if len(s) == 4:
        f = 1
        if (s[0] == 'A' and s[2:] == 'GC') or (s[0:2] == 'AG' and s[3] == 'C'):
            return 0
    return s[f:] != 'AGC' and s[f:] != 'ACG' and s[f:] != 'GAC'
    

@lru_cache(maxsize=None)
def dfs(n, s):
    if not valid(s):
        return 0

    if n == N:
        return 1

    f = len(s) == 4
    a = dfs(n+1, s[f:] + 'A')
    b = dfs(n+1, s[f:] + 'C')
    c = dfs(n+1, s[f:] + 'G')
    d = dfs(n+1, s[f:] + 'T')
    return (a + b + c + d) % MOD
    

N = int(input())
ans = dfs(0, '')
print(ans)


### FIXED CODE ###

from functools import lru_cache
MOD = 1000000007

def valid(s):
    f = 0
    if len(s) == 4:
        f = 1
        if (s[0] == 'A' and s[2:] == 'GC') or (s[0:2] == 'AG' and s[3] == 'C'):
            return 0
    return s[f:] != 'AGC' and s[f:] != 'ACG' and s[f:] != 'GAC'
    

@lru_cache(maxsize=None)
def dfs(n, s):
    if not valid(s):
        return 0

    if n == N:
        return 1

    f = len(s) == 4
    a = dfs(n+1, s[f:] + 'A')
    b = dfs(n+1, s[f:] + 'C')
    c = dfs(n+1, s[f:] + 'G')
    d = dfs(n+1, s[f:] + 'T')
    return (a + b + c + d) % MOD
    

N = int(input())
ans = dfs(0, '')
print(ans)
from fractions import gcd
A, B = map(int, input().split())

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

ans = lcm(A, B)
print(ans)

### FIXED CODE ###

import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

l = 0
r = 0

for i, j in enumerate(itertools.permutations(range(1,N+1)), start=1):
    if j == P and j == Q:
        l, r = i, i
    elif j == P:
        l = i
    elif j == Q:
        r = i
    else:
        pass

print(abs(l-r))
s = input()
x, y = map(int, input().split())

mv = [len(e) for e in s.split("T")]
mv_x = mv[2::2]
mv_y = mv[1::2]


def solve_dp(li, start, end):
    l = len(li)
    mx = sum(li)

    left = start - mx
    right = start + mx

    if end > right or end < left:
        return 0

    dp = [[0] * (2 * mx + 1) for _ in range(l + 1)]
    dp[0][start] = 1
    for i, e in enumerate(li, 1):
        for j in range(left, right + 1):
            if left <= j - e <= right:
                dp[i][j] |= dp[i-1][j-e]
            if left <= j + e <= right:
                dp[i][j] |= dp[i-1][j+e]

    return dp[l][end]


bl_x = solve_dp(mv_x, mv[0], x)
bl_y = solve_dp(mv_y, 0, y)

if bl_x and bl_y:
    ans = "Yes"
else:
    ans = "No"

print(ans)


### FIXED CODE ###

s = input()
x, y = map(int, input().split())

mv = [len(e) for e in s.split("T")]
mv_x = mv[2::2]
mv_y = mv[1::2]


def solve_dp(li, start, end):
    l = len(li)
    mx = sum(li)

    if l == 0:
        return start == end

    left = start - mx
    right = start + mx

    if end > right or end < left:
        return 0

    dp = [[0] * (2 * mx + 1) for _ in range(l + 1)]
    dp[0][start] = 1
    for i, e in enumerate(li, 1):
        for j in range(left, right + 1):
            if left <= j - e <= right:
                dp[i][j] |= dp[i-1][j-e]
            if left <= j + e <= right:
                dp[i][j] |= dp[i-1][j+e]

    return dp[l][end]


bl_x = solve_dp(mv_x, mv[0], x)
bl_y = solve_dp(mv_y, 0, y)

if bl_x and bl_y:
    ans = "Yes"
else:
    ans = "No"

print(ans)