Harryxun/stf_run huggingface dataset:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

import sympy
N = I()
a = sympy.divisor_count(N - 1)

A = sympy.divisors(N)

cnt = 0
for i in range(1, len(A) // 2 + 1):
    x = A[i]
    y = A[-i - 1]
    while y > x:
        if (y - 1) % x == 0:
            cnt += 1
            break
        elif y % x == 0:
            y //= x
        else:
            break
    if y == x:
        cnt += 1

ans = a - 1 + cnt + 1
print(ans)

### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = I()
B = make_divisors(N - 1)
b = len(B)

A = make_divisors(N)

cnt = 0
for i in range(1, len(A) // 2 + 1):
    x = A[i]
    y = A[-i - 1]
    while y > x:
        if (y - 1) % x == 0:
            cnt += 1
            break
        elif y % x == 0:
            y //= x
        else:
            break
    if y == x:
        cnt += 1

ans = b - 1 + cnt + 1
print(ans)
# coding: utf-8
N = int(input())
Ls = sorted(list(map(int,input().split())))
print("Yes" if max(Ls) < sum(Ls) - max(Ls) else "No")

### FIXED CODE ###

from sys import stdin
T,X = map(int, stdin.readline().rstrip().split())
print(float(T/X))
y = list(input())
n = sum(y[i]=1 for i in y)
print(n)

### FIXED CODE ###

s = input()
print(s.count('1'))
s=inp()
#s = (1 2 2) 
s = s.split(" ")


densya = s[0]*s[1]
taxi   = s[3]

if ( densya < taxi):
    print(densya)
else:
    print(taxi)

### FIXED CODE ###

s=input()
#s = ("4 2 9")
#print(s) 
s = s.split(" ")


densya = int(s[0])*int(s[1])
taxi   = int( s[2] )

if ( densya < taxi):
    print(densya)
else:
    print(taxi)
count = 0
for s in input():
  if int(s) == 1:
    count+=1
print(count)[

### FIXED CODE ###

count = 0
for s in input():
  if int(s) == 1:
    count+=1
print(count)
input()
n=sorted(list(map(int,input().split())))
m=n[0]
a={}
for x in range(1,int(m**.5)+1):
    if m%x==0:a|={x,m//x}
for c in sorted(list(a)):
    for k in n[1:]:
        if k%c:break
    else:print(c)


### FIXED CODE ###

input()
n=sorted(list(map(int,input().split())))
m=n[0]
a=set()
for x in range(1,int(m**.5)+1):
    if m%x==0:a|={x,m//x}
for c in sorted(list(a)):
    for k in n[1:]:
        if k%c:break
    else:print(c)
import collections

n=int(input())
b=[[0,0,0]]
a=[int(i) for i in input().split()]
for i in range(n):
    k=b[-1].index(a[i])
    c=[]
    for j in range(3):
        if j==k:
            c.append(b[-1][j]+1)
        else:
            c.append(b[-1][j])
    b.append(c)
#print(b)
x=1
for i in range(n):
    x=x*b[i].count(a[i])%1000000007

print(x)


### FIXED CODE ###

import collections

n=int(input())
b=[[0,0,0]]
a=[int(i) for i in input().split()]

def my_index(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

for i in range(n):
    k=my_index(b[-1],a[i])
    if k==-1:
        print(0)
        break
    c=[]
    for j in range(3):
        if j==k:
            c.append(b[-1][j]+1)
        else:
            c.append(b[-1][j])
    b.append(c)
else:
    x=1
    for i in range(n):
        x=x*b[i].count(a[i])%1000000007
    print(x)
all = input()
all = all.split(' ')
all = [int(num) for num in all]
if sum(all) >= 22:
  return'bust'
else:
  return 'win'

### FIXED CODE ###

all = input()
all = all.split(' ')
all = [int(num) for num in all]
if sum(all) >= 22:
    print('bust')
else:
    print('win')
N = int(input(""))
R = int(input(""))

if N < 10:
    R += 100 * (10 - N)

print(R)

### FIXED CODE ###

N, R = map(int, input().split())

if N < 10:
    print(R + 100 * (10 - N))
else:
    print(R)
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

PQ = {}
for i in range(1, len(XY)):
    pq = XY[i][0] - XY[i-1][0], XY[i][1] - XY[i-1][1]
    if pq in PQ.keys():
        PQ[pq] += 1
    else:
        PQ[pq] = 1
pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])


### FIXED CODE ###

import sys

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

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

if N == 1:
    print(1)
    sys.exit()

PQ = {}
for i in range(len(XY)):
    for j in range(len(XY)):
        pq = XY[i][0] - XY[j][0], XY[i][1] - XY[j][1]
        if pq == (0, 0):
            continue
        if pq in PQ.keys():
            PQ[pq] += 1
        else:
            PQ[pq] = 1

pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])
n = int(input())
al = [0 for _ in range(n)]
for i in range(n):
    al[i] = int(input())

def check(al,bl,i):
    bl.append(i)
    i = al[i]-1
    if len(bl) == len(al):
        print(-1)
    elif i in bl:
        print(-1)
    elif i == 1:
        print(len(bl))
    else:
        check(al,bl,i)

bl = []
check(al,bl,0)

### FIXED CODE ###

n = int(input())
al = [int(input()) for i in range(n)]

i = 0
for j in range(n):
    i = al[i]-1
    if i == 1:
        print(j+1)
        exit()
print(-1)
N,K=map(int,input().split())
z=[tuple(map(int,input().split()))for _ in range(N)]
x=[i for i,_ in z]
y=[j for _,j in z]
x.sort()
y.sort()
a=10**20
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                l,r,d,u=x[i],x[j],y[k],y[l]
                if sum([1for v,w in z if l<=v<=r and d<=w<=u else 0])>=K:
                    a=min(a,(r-l)*(u-d))
print(a)

### FIXED CODE ###

n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)
# coding: utf-8

n,x = map(int, input().split())

l,p = [1],[1]
for i in range(n):
    l.append(a[i]*2+3)
    p.append(a[i]*2+1)

def f(n,x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1 + l[n-1]:
        return f(n-1,x-1)
    else:
        return p[n-1]+1+f(n-1,x-2-l[n-1])

print(f(n,x))


### FIXED CODE ###

# coding: utf-8

n,x = map(int, input().split())

l,p = [1],[1]
for i in range(n):
    l.append(l[i]*2+3)
    p.append(p[i]*2+1)

def f(n,x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1 + l[n-1]:
        return f(n-1,x-1)
    else:
        return p[n-1]+1+f(n-1,x-2-l[n-1])

print(f(n,x))
while True:
    a,b = map(int, input().split()
    if a ==0 and b == 0:
        break
    if a > b:
        c = a
        a = b
        b = c
    print("{} {}".format(a,b))


### FIXED CODE ###

while True:
    a,b = map(int, input().split())
    if (a,b) == (0,0) :
        break
    elif a > b:
        c = a
        a = b
        b = c
    print("{} {}".format(a,b))
n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
    #print(b-1,n-a)
    ans = min(a-1, n-b) + 1  + (B-A-1)//2
else:
    ans = (b-a)//2
print(ans)

### FIXED CODE ###

n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
    ans = min(a-1, n-b) + 1 + (b-a-1)//2
else:
    ans = (b-a)//2
print(ans)
n,k = map(int, input().split())

if n %k !=0:
  print(m%k)
else:
  print(0)

### FIXED CODE ###

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

if n %k :
  print(1)
else:
  print(0)
n=int(input())
c=[list(map(int,input().split())) for _ in range(n)]
c.sort()
q,w=c[n//2][0],min(c[n//2][1],c[n//2+1][1])
c.sort(key=lambda x: x[1])
e,r=max(c[n//2][0],c[n//2-1][1]),c[n//2][1]
if w<=e:
    print(max(w-q,r-e)+1)
else:
    print(r-q+1)

### FIXED CODE ###

n=int(input())
a,b=[],[]
for _ in range(n):
    i,j=map(int,input().split())
    a+=[i]
    b+=[j]
a.sort()
b.sort()
c=n//2
if n%2==1:
    print(b[c]-a[c]+1)
else:
    print(b[c]-a[c]+b[c-1]-a[c-1]+1)
x = int(input())
from sympy import nextprime
print(nextprime(x - 1))

### FIXED CODE ###

n = int(input())
for i in range(n, 100004):
    flag = 0
    for j in range(2, int(i**0.5) + 1):
        if i % j == 0:
            flag = 1
            break
    if flag == 0:
        print(i)
        break
import sys
sum = 1;
for i in sys.stdin.strip():
    if i != "0":
        print('Case {}: {}'.format(sum, i))
        sum+= 1
    else:
        break

### FIXED CODE ###

import sys
sum = 1;
for i in sys.stdin:
    x = i.strip()
    if x != "0":
        print('Case {}: {}'.format(sum, x))
        sum+= 1
    else:
        break
a,b=input().split()
if a<b:
  print("<")
elif a==b:
  print("=")
else a>b:
  print(">")


### FIXED CODE ###

a,b=input().split()
if (a<b):
  print("<")
elif (a==b):
  print("=")
else :
  print(">")
N = int(input())
a = list(map(int, input().split()))

ans = abs(sum(a[1:])-a[0])
X = sum(a)

for i in range(1,N):
    sa = abs(X - 2*sum(a[:i]))
    ans = min(ans,sa)

print(ans)


### FIXED CODE ###

A, B = map(int, input().split())
aa = A+B

if A % 3 == 0 or B%3==0 or aa%3==0:
    print("Possible")
else:
    print("Impossible")
s,t = map(input().split())
print(s+t)

### FIXED CODE ###

s,t = input().split()
print(t+s)
x, y = map(int, input().split())
d = abs(abs(x) - abs(y))
if 0 <= x < y or x < y <= 0:
  print(d)
elif y <= 0 <= x or x < 0 < y:
  print(d+1)
else
  print(d+2)

### FIXED CODE ###

x, y = map(int, input().split())
d = abs(abs(x) - abs(y))
if 0 <= x < y or x < y <= 0:
  print(d)
elif y < 0 < x or x < 0 < y:
  print(d+1)
elif 0 < y < x or y < x < 0:
  print(d+2)
elif y == 0 < x or y < x == 0:
  print(d+1)
else:
  raise Exception
n,m,c = map(int,input().split())
input_b = map(int,input().split())
a_list=[input() for i in range(n)]
for i in range(n):
  answer = c
  count = 0
  aitems = map(int,a_list[i].split())
  for j in range(m):
    answer += input_b[m] * aitems[m]
  if answer > 0
    count+=1
print count

### FIXED CODE ###

n,m,c = map(int,input().split())
input_b = list(map(int,input().split()))
a_list=[input() for i in range(n)]
count = 0
for i in range(n):
  answer = c
  aitems = list(map(int,a_list[i].split()))
  for j in range(m):
    answer += input_b[j] * aitems[j]
  if answer > 0:
    count+=1
print(count)
N=int(input())
S,T=map(str,input().split())
U=str()
for i in range(N):
  U.append(S[i])
  U.append(T[i])
print(U)

### FIXED CODE ###

N=int(input())
S,T=map(str,input().split())
a=str()
for i in range(N):
  a+=S[i]
  a+=T[i]
print(a)
while True
    x,y = map(int,input().split)
    if (x,y) == (0,0):
        break
    else:
        if x < y:
            print(x,y)
        else:
            print(y,x)


### FIXED CODE ###

while True:
    x,y = map(int,input().split())
    if (x,y) == (0,0):
        break
    else:
        if x < y:
            print(x,y)
        else:
            print(y,x)
N = int(input())
a=[]
for i in range(N):
  a.append(int(input()))

base=max(a)
maxkosu=a.count(base)
if maxkosu>1:
  for i in range(N):
    print(base)
else:
  maxidx=a.index(base)
  reigai=max(max(a[:maxidx]), max(a[maxidx+1:]))
  for i in range(N):
    if i==maxidx:
      print(reigai)
    else:
      print(base)
  

### FIXED CODE ###

N = int(input())
a=[]
for i in range(N):
  a.append(int(input()))

base=max(a)
maxkosu=a.count(base)
if maxkosu>1:
  for i in range(N):
    print(base)
else:
  maxidx=a.index(base)
  a[maxidx]=-1
  reigai=max(a)
  for i in range(N):
    if i==maxidx:
      print(reigai)
    else:
      print(base)
W, H, x, y, r = map(int, raw_input().split())
if r <= x and r <= y and r + y <= H and r + x <= W :
print "Yes"
else:
print "No"

### FIXED CODE ###

W, H, x, y, r = map(int, raw_input().split())
if r <= x and r <= W - x and r <= y and r <= H - y:
   print 'Yes'
else:
   print 'No'
def check(List):
    List.sort()
    List.revers()
    if List[0]^2 == List[1]^2+List[2]^2:
        return True
    else:
        return False

while True:
    N = input()
    
    for i in range(N):
        list = []
        for j in range(3):
            list.append(input())
        
        print check(list)
        

### FIXED CODE ###

def check(List):
    List.sort()
    List.reverse()
    if List[0]**2 == List[1]**2+List[2]**2:
        return "YES"
    else:
        return "NO"

N = input()
    
for i in range(N):
    list = map(int, raw_input().split())
    print check(list)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
dp = [0] * (N+1)
dp[0] = 1
e = 1e9 + 7
for i in range(1, N+1):
    if i not in A:
        if i == 1:
            dp[i] = 1
            continue
        else:
            dp[i] = (dp[i-1] + dp[i-2]) % e
print(int(dp[N])

### FIXED CODE ###

n, m = map(int, input().split())
mod = 1e+9+7
dp = [0]*(n+1)
dp[0] = 1
isPass = [1]*(n+1)
for _ in range(m):
    a = int(input())
    isPass[a] = 0
for i in range(n):
    for j in range(i+1, min(n, i+2)+1):
        if isPass[j]:
            dp[j] += dp[i]
            dp[j] %= mod
print(int(dp[n]))
n,t=map(int,input().split())
clis=[]
tlis=[]
for i in range(n):
  a,b=map(int,input().split())
  clis.append(a)
  tlis.append(b)
lis2=[]
for i in range(n):
  if tlis[i] > t:
    pass
  else:
    lis2.append(clis[i])
if len(lis2)==0:
  print(TLE)
else:
  print(min(lis2))

### FIXED CODE ###

n,t=map(int,input().split())
clis=[]
tlis=[]
for i in range(n):
  a,b=map(int,input().split())
  clis.append(a)
  tlis.append(b)
lis2=[]
for i in range(n):
  if tlis[i] > t:
    pass
  else:
    lis2.append(clis[i])
if len(lis2)==0:
  print("TLE")
else:
  print(min(lis2))
# -*- coding: utf-8 -*-
from collections import Counter
from operator import itemgetter
def solve():
    input()
    V = list(map(int, input().split()))
    l = sorted(Counter(V[::2]).items()+[(0,0)], key=itemgetter(1), reverse=True)
    u = sorted(Counter(V[1::2]).items()+[(0,0)], key=itemgetter(1), reverse=True)
    res = sum(map(itemgetter(1), l+u)) - (max(l[0][1]+u[1][1], l[1][1]+u[0][1]) if l[0][0]==u[0][0] else (l[0][1]+u[0][1]))
    return str(res)

if __name__ == '__main__':
    print(solve())



### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import defaultdict
from operator import itemgetter
def solve():
    n = int(input())
    V = list(map(int, input().split()))
    l = defaultdict(int)
    u = defaultdict(int)
    for i in range(0,n,2):
        l[V[i]] += 1
        u[V[i+1]] += 1

    l = sorted(list(l.items()),key=itemgetter(1))[::-1]
    u = sorted(list(u.items()),key=itemgetter(1))[::-1]
    if len(l) == len(u) == 1:
        if l[0][0] != u[0][0]:
            res = 0
        else:
            res = min(l[0][1], u[0][1])
    else:
        if l[0][0] != u[0][0]:
            res = sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[1:]))
        elif len(u) == 1 or (len(l) > 1 and l[1][1]+u[0][1] > l[0][1]+u[1][1]):
            res = l[0][1] + sum(map(itemgetter(1), l[2:])) + sum(map(itemgetter(1), u[1:]))
        else:
            res = u[0][1] + sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[2:]))

    return str(res)

if __name__ == '__main__':
    print(solve())
# review
import copy
n, a, b, c = map(int, input().split())
lList = []

for _ in range(n) :
        lList.append(int(input()))

lList.sort()
goal = [a, b, c]
goal.sort()

def removed(i,j) :
        goal.remove(i)
        lList.remove(j)

mp = 0
def pick(x, y) : # if same value & goal < lList
        mp = 0
        for i in copy.copy(x) :
                for j in copy.copy(y) :
                        if i == j and i in goal:
                                removed(i,j)
        for i in copy.copy(x) :
                for j in copy.copy(y) :
                        if i < j and i in goal:
                                mp += j - i 
                                removed(i,j)

pick(goal,lList)      


diffList = []
diff = 10
for j in lList :
        for i in goal :
                if abs(i-j) < 10 :
                        diff = min(diff, abs(i-j))
        if diff != 10 :
                diffList.append([diff, i, j])
        diff = 10
for i in diffList :      
        mp += i[0]       
        goal.remove(i[1])
        lList.remove(i[2])

add2 = []
for i in lList :
        for j in lList[i+1:] :
                add2.append(i + j, i, j)
# ------------------------------------------------------
# addList = []
# diff = 10
# for j in add2 :
#         for i in goal :
#                 if abs(i-j[0]) < 10 :
#                         diff = min(diff, abs(i-j[0]))
#         if diff != 10 :
#                 diffList.append([diff, i, j[0]])
#         diff = 10
# for i in diffList :      
#         mp += i[0]       
#         goal.remove(i[1])
#         lList.remove(i[2])


             
print(mp)


### FIXED CODE ###

# review
N,A,B,C = map(int,input().split())
L = [int(input()) for _ in range(N)]
 
def f(i,a,b,c):
    if i == N:
        if min(a, b, c) <= 0:
            return 10**9
        return abs(a-A)+abs(b-B)+abs(c-C)-30
    costx = f(i+1,a,b,c)
    costA = f(i+1,a+L[i],b,c)+10
    costB = f(i+1,a,b+L[i],c)+10
    costC = f(i+1,a,b,c+L[i])+10
    return min(costx,costA,costB,costC)
 
print(f(0,0,0,0))
L = map(int, input())

l = L/3

l*l*l

print('{:.0f}'.format(l*l*l))

### FIXED CODE ###

import math

N, M = map(int, input().split(' '))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
cnt = 0

if N > 1:
    cnt += combinations_count(N, 2)
if M > 1:
    cnt += combinations_count(M, 2)

print(cnt)
N = int(input())
H = list(map(int, input().split()))

dp = [0] * N
dp[1] = abs(H[1]-H[0])

def func(i):
    if i == N:
        return 0
    else:
        dp[i] = min((dp[i-1]+abs(H[i-1]-H[i]), dp[i-2]+abs(H[i-2]-H[i])))
        return func(i+1)

func(2)
print(dp[-1])

### FIXED CODE ###

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

dp = [0] * N
dp[1] = abs(H[1]-H[0])
for i in range(2, N):
    dp[i] = min((dp[i-1]+abs(H[i-1]-H[i]), dp[i-2]+abs(H[i-2]-H[i])))

print(dp[N-1])
n=int(input())
dp=[float("inf")]*100010
dp[0]=0

for i in range(n+1):
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 6
    power = 1
    while power <= n:
        dp[i + power] = min(dp[i + power],dp[i] + 1)
        power *= 9

print(dp[n])

### FIXED CODE ###

N=int(input())
dp=[float('inf')]*100010
dp[0]=0
base=[1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]


for i in range(N+1):
    for power in base:
        dp[i]=min(dp[i],dp[i-power]+1)

print(dp[N])
x = input()
if x>= 30:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x = int(input())
if x>= 30:
  print("Yes")
else:
  print("No")
a = []
for _ in range(3):
    a.append(list(map(int, input().split())))
n = int(input())
b = []
for _ in range(n):
    b.append(int(input()))

check = [[False] * 3 for _ in range(3)]

for b_one in b:
    for i in range(3):
        for j in range(3):
            if a[i][j] == b_one:
                check[i][j] = True

if check[0][0] and check[0][1] and check[0][2]:
    print('Yes')
    return
if check[1][0] and check[1][1] and check[1][2]:
    print('Yes')
    return
if check[2][0] and check[2][1] and check[2][2]:
    print('Yes')
    return
if check[0][0] and check[1][0] and check[2][0]:
    print('Yes')
    return
if check[0][1] and check[1][1] and check[2][1]:
    print('Yes')
    return
if check[0][2] and check[1][2] and check[2][2]:
    print('Yes')
    return
if check[0][0] and check[1][1] and check[2][2]:
    print('Yes')
    return
if check[0][2] and check[1][1] and check[2][0]:
    print('Yes')
    return

print('No')

### FIXED CODE ###

def resolve():
    a = []
    for _ in range(3):
        a.append(list(map(int, input().split())))
    n = int(input())
    b = []
    for _ in range(n):
        b.append(int(input()))

    check = [[False] * 3 for _ in range(3)]

    for b_one in b:
        for i in range(3):
            for j in range(3):
                if a[i][j] == b_one:
                    check[i][j] = True

    if check[0][0] and check[0][1] and check[0][2]:
        print('Yes')
        return
    if check[1][0] and check[1][1] and check[1][2]:
        print('Yes')
        return
    if check[2][0] and check[2][1] and check[2][2]:
        print('Yes')
        return
    if check[0][0] and check[1][0] and check[2][0]:
        print('Yes')
        return
    if check[0][1] and check[1][1] and check[2][1]:
        print('Yes')
        return
    if check[0][2] and check[1][2] and check[2][2]:
        print('Yes')
        return
    if check[0][0] and check[1][1] and check[2][2]:
        print('Yes')
        return
    if check[0][2] and check[1][1] and check[2][0]:
        print('Yes')
        return

    print('No')

resolve()
def reversed_num(num):
  num_len=len(bin(num))-2
  f=2**num_len-1
  return num^f
n=int(input())
number=list(map(int,input().split()))
number.sort()
count=0
while len(number)>0:
  x=reversed_num(number[-1])+1
  if x in number:
    number.remove(x)
    count+=1
  number.pop()
print(count)


### FIXED CODE ###

import bisect
def reversed_num(num):
  num_len=len(bin(num))-2
  f=2**num_len-1
  return num^f
n=int(input())
number=list(map(int,input().split()))
number.sort()
count=0
while len(number)>0:
  k=number.pop()
  if len(number)==0:
    break
  if k==int(k):
    x=reversed_num(k)+1
    y=bisect.bisect_left(number,x)
    if x>number[-1]:
      y-=1
    if number[y] ==x:
      number[y]-=0.5
      count+=1
print(count)
a,b,k = map(int,input().split())
if a < b:
    a,b = b,a
t=[1]
for i in range(2,b//2):
    if a%i==0 and b%i == 0:
        t.append(i)
print(t[k-1])

### FIXED CODE ###

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

t=[]
for i in range(1, min(a,b)+1):
    if a%i == 0 and b%i == 0:
        t.append(i)
t = sorted(t,reverse=True)
print(t[k-1])
c=0;a=input();for i in input().split():
  c+=1/int(i)
print(1/c)

### FIXED CODE ###

c=0
a=input()
for i in input().split():
  c+=1/int(i)
print(1/c)