Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 9)

class Union_Find:
    def __init__(self, n):
        self.root = [-1]*n
    
    def find(self, x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find(self.root[x])
            return root[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        else:
            self.root[x] += self.root[y]
            self.root[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)


n, m = map(int, input().split())
uf = Union_Find(n)

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.unite(a, b)

ans = 0
for i in range(n):
    size = uf.root[i]*(-1)
    ans = max(ans, size)

print(ans)

### FIXED CODE ###

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

root = [-1]*n
def r(x):
    if root[x] < 0:
        return x
    else:
        root[x] = r(root[x])
        return root[x]

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    unite(a, b)

ans = 0
for i in range(n):
    ans = max(ans, -root[i])

print(ans)
a = str(input())
b = str(input())
print(a + b)

### FIXED CODE ###

a, b = input(). split()
c = (b + a)
print(c)
# AGC005A

# TLE 2/13
x = input()
while 'ST' in x:
    x = x.replace('ST', '', 1)
print(len(x))


### FIXED CODE ###

x = input()
while 'ST' in x:
    x = x.replace('ST', '')
    n = len(x) // 2
    if ('T' not in x[:n]) and ('S' not in x[n:]):
        x = ''
        break
print(len(x))
# 93
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in l[:]:
    if a+k-1 < i < b-k+1:
        l.remove(i)

for i in l:
    print(i)

### FIXED CODE ###

s = sorted(input())
if s[0] == 'a' and s[1] == 'b' and s[2] == 'c':
    print('Yes')
else:
    print('No')
from math import factorial
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def p(a, b):
    return factorial(a)//factorial(a-b)


MOD = 10**9+7
N, K = map(int, input().split())
edges = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N-1)]
adj = [[] for _ in range(N)]

for a, b in edges:
    adj[a].append(b)
    adj[b].append(a)

# current parent
Q = []
for a in adj[0]:
    Q.append((a, 0))
ans = p(K, len(adj[0])+1)
ans %= MOD

while Q:
    current, prev = Q.pop()
    child = len(adj[current])-1
    ret = p(K-2, child)
    ans *= ret

    ans %= MOD
    for a in adj[current]:
        if a == prev:
            continue
        else:
            Q.append((a, current))
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

# -*- coding: utf-8 -*-


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def perm(self, a, b):
        if a < b or a < 0 or b < 0:
            return 0
        ret = self.f[a]*self.inv[a-b]
        ret %= self.mod
        return ret


MOD = 10**9+7
N, K = map(int, input().split())
edges = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N-1)]
adj = [[] for _ in range(N)]

F = FactMod(K+1, MOD)

for a, b in edges:
    adj[a].append(b)
    adj[b].append(a)

# current parent
Q = []
for a in adj[0]:
    Q.append((a, 0))
ans = F.perm(K, len(adj[0])+1)
ans %= MOD

while Q:
    current, prev = Q.pop()
    child = len(adj[current])-1
    ret = F.perm(K-2, child)
    ans *= ret
    ans %= MOD
    for a in adj[current]:
        if a == prev:
            continue
        else:
            Q.append((a, current))
print(ans)
from math import gcd
n=int(input())
a=list(map(int,input().split()))
b=[]
if n==2:
  print(max(a))

else:
  for i in range(n):
    x=a[i]
    y=a[i-1]
    b+=list(gcd(x,y))
  b.sort()
  print(b[2])


### FIXED CODE ###

import math

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

def segfunc(x, y):
    return math.gcd(x,y)

def init(init_val):
    # set_val
    for i in range(n):
        seg[i+num-1] = init_val[i]
    # built
    for i in range(num-2, -1, -1):
        seg[i] = segfunc(seg[2*i+1], seg[2*i+2])

def update(k, x):
    k += num - 1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[2*k+1], seg[2*k+2])

def query(p, q):
    if q <= p:
        return ide_ele
    p += num - 1
    q += num - 2
    res = ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res, seg[p])
        if q&1 == 1:
            res = segfunc(res, seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res, seg[p])
    else:
        res = segfunc(segfunc(res, seg[p]), seg[q])
    return res

# identity element
ide_ele = 0

# num: n以上の最小の2のべき乗
num = 2**(n-1).bit_length()
seg = [ide_ele]*2*num

a=init(a)

ans=1
for i in range(n):
    ans=max(ans,math.gcd(query(0,i),query(i+1,n)))


print(ans)
a = int.input()
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  else:
    if l[i]>M:
      M = l[i]
    else:
      pass
print(M-m)

### FIXED CODE ###

a = int(input())
l = list(map(int,input().split()))
m = l[0]
M = l[0]
for i in range(1,a):
  if l[i]<m:
    m = l[i]
  else:
    if l[i]>M:
      M = l[i]
    else:
      pass
print(M-m)
n=int(input())
c=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1
  b-=1
  c[a].append((b,i))
  c[b].append((a,i))

ans=[0]*(n-1)
g=[0]*n
def dfs(v,h=-1):
  res=1
  for i,j in c[v]:
      if g[i]:
            continue
      g[v]=1
      if h==res:
            res+=1
      ans[j]=res
      dfs(i,res)
      res+=1

dfs(0)
print(max(ans))
for i in ans:
      print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
N = int(input())
AB = [tuple(map(int,input().split())) for i in range(N-1)]
es = [[] for i in range(N)]
for i,(a,b) in enumerate(AB):
    a,b = a-1,b-1
    es[a].append((b,i))
    es[b].append((a,i))
ans=[0]*(N-1)
g=[0]*N
def dfs(v,h=-1):
  res=1
  for i,j in es[v]:
      if g[i]:
            continue
      g[v]=1
      if h==res:
            res+=1
      ans[j]=res
      dfs(i,res)
      res+=1

dfs(0)
print(max(ans))
for i in ans:
      print(i)
N, M = map(int, input().split(" "))
stores = dict()
p = 10000000000

for i in range(N):
    if p==1 and stores[p] >= M:
      break
    Ai, Bi = map(int, input().split(" "))
    if Ai in stores:
        stores[Ai] += Bi
    else:
        stores[Ai] = Bi
    p = min(p, Ai)


price = 0
for i, c in sorted(stores, key=lambda x: x[0]):
    if M <= c:
        price += i * M
        break
    else:
        price += i * c
        M -= c

print(price)


### FIXED CODE ###

N, M = map(int, input().split(" "))
stores = []

for i in range(N):
    Ai, Bi = map(int, input().split(" "))
    stores.append((Ai, Bi))    

price = 0
for a, b in sorted(stores, key=lambda x: x[0]):
    if M <= b:
        price += a * M
        break
    else:
        price += a * b
        M -= b
print(price)
import math
a,b=map(int,input().split())
if a==1|| b==1:
  k=1
elif:
	k=math.ceil((a*b)/2)
print(k)


### FIXED CODE ###

import math
H,W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
elif H * W % 2 == 0:
    print( math.floor((H * W) /2 ))
else:
    print(math.floor((H * W) / 2) + 1)
while 1:
	n=input()
	if n==0:break
	m=input()
	a=raw_input()
	P="I"+"OI"*n
	l=1+2*n
	c=0
	for i in range(m-l+1):
		for k in range(l):
			if a[i+k]!=P[k]
				break
		else:c+=1
	print c
	

### FIXED CODE ###

while 1:
	n=int(raw_input())
	if n==0:break
	m=int(raw_input())
	a=raw_input()
	P="I"+"OI"*n
	l=1+2*n
	c=0
	for i in range(m-l+1):
		if a[i:i+l]==P:c+=1
	print c
"""
左・上からゴリゴリ攻めていくパターン
一回通ったかどうかのフラグが必要
"""

cnt = [[0] * (W+1) for i in range(H+1)]
# 横
for i in range(H):
    done = [False] * (W+1)
    for j in range(W):
        l = 0
        if done[j]: continue
        if S[i][j] == ".":
            while j+l < W:
                if S[i][j+l] == ".":
                    l += 1
                else:
                    break
        for k in range(j,j+l):
            cnt[i][k] += l
            done[k] = True

# 縦
for j in range(W):
    done = [False] * (H+1)
    for i in range(H):
        l = 0
        if done[i]: continue
        if S[i][j] == ".":
            while i+l < H:
                if S[i+l][j] == ".":
                    l += 1
                else:
                    break
        for k in range(i,i+l):
            cnt[k][j] += l
            done[k] = True

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,cnt[i][j])
print(ans-1)

### FIXED CODE ###

H,W = map(int,input().split())
S = [input() for i in range(H)]

# 4方向の累積和をとって計算する
Rs = [[0]*W for i in range(H)]
Ls = [[0]*W for i in range(H)]
Ds = [[0]*W for i in range(H)]
Us = [[0]*W for i in range(H)]

for i in range(H):
    tmp = 0
    # 順方向(左にどれだけ伸びてるか)
    for j in range(W):
        if S[i][j] == '#':
            tmp = 0
        else:
            tmp += 1
            Ls[i][j] = tmp
    tmp = 0
    # 逆方向(右にどれだけ伸びてるか)
    for j in reversed(range(W)):
        if S[i][j] == '#':
            tmp = 0
        else:
            tmp += 1
            Rs[i][j] = tmp

# 行列転置 順番逆にするだけ
for j in range(W):
    tmp = 0
    # 順方向 上にどれだけ伸びているか
    for i in range(H):
        if S[i][j] == '#':
            tmp = 0
        else:
            tmp += 1
            Us[i][j] = tmp
    tmp = 0
    # 順方向 下にどれだけ伸びているか
    for i in reversed(range(H)):
        if S[i][j] == '#':
            tmp = 0
        else:
            tmp += 1
            Ds[i][j] = tmp

ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#': 
            continue
        # 上下左右に伸びた数を重なっている部分引く
        tmp = Rs[i][j] + Ls[i][j] + Ds[i][j] + Us[i][j] - 3
        ans = max(ans, tmp)
print(ans)
a,b=map(int,input().split())
if (a+b)/2.is_integer():
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

a,b=map(int,input().split())
if ((a+b)/2).is_integer():
  print((a+b)//2)
else:
  print("IMPOSSIBLE")
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""
t=1
#t=ii()
for _ in range(t):
    n=ii()
    a=ll()
    i=n-1;
    while(i):
        print(a[i],end=" ")
        i-=2
    for i in range(n%2,n,2):
        print(a[i],end=" ")

### FIXED CODE ###

import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""
t=1
#t=ii()
for _ in range(t):
    n=ii()
    a=ll()
    i=n-1;
    while(i>-1):
        print(a[i],end=" ")
        i-=2
    for i in range(n%2,n,2):
        print(a[i],end=" ")
n, m, l = map(int, input().split(' '))

A = []
for i in range(n):
    A.append(list(map(int, input().split(' '))))

B = []
for i in range(m):
    B.append(list(map(int, input().split(' '))))

C = [[0 for i in range(n)] for j in range(l)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for c in C:
    print(' '.join([str(x) for x in c]))

### FIXED CODE ###

n, m, l = map(int, input().split())

A = []
for _ in range(n):
    A.append(list(map(int, input().split())))

B = []
for _ in range(m):
    B.append(list(map(int, input().split())))

C = [ [ 0 for _ in range(l) ] for _ in range(n) ]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k]*B[k][j]

for i in range(n):
    sep = ''
    for j in range(l):
        print(sep+str(C[i][j]), end='')
        sep = ' '
    print()
nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
for i in range(K+1)[1::]:
	if i > N-K+1:
        A = combination(N-K+1, i)
        P = combination(K-1, i-1)
        B = A * P
        print(B % (10**9+7))
	else:
		print(0)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = combination(n-1,r) + combination(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
for i in range(1, K+1):
	if i <= N-K+1:
		A = combination(N-K+1, i)
		P = combination(K-1, i-1)
		B = A * P
		print(B % (10**9+7))
	else:
		print(0)
import sys
a, b = map(int, sys.stdin.readline().rstrip())
c = a * b
if c % 2 == 0: return 'Even'
else:          return 'Odd'

### FIXED CODE ###

import sys
a, b = map(int, sys.stdin.readline().rstrip().split())
c = a * b
if c % 2 == 0: print 'Even'
else:          print 'Odd'
s = set()
for _ in range(int(input()):
               a = input()
               s.add(a)
print(len(s)) 

### FIXED CODE ###

s = set()
for _ in range(int(input())):
				a = input()
				s.add(a)
print(len(s))
# ABC134-D

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  a=1
  ind=0
  ad=l[0]
  while True:
    if ind+a<n:
      ind+=a
      ad+=l[ind]
    else:
      if ad%2!=l[a-1]:
        # print(ad,l[a-1])
        print(-1)
        exit()
      else:
        a+=1
        ad=0
        ind=a-1
        if a==n:
          break

  ans=[]
  for i,x in enumerate(l):
    if x==1:
      ans.append(i+1)

  print(len(ans))
  if len(ans)==0:
    exit()
  print(' '.join([str(x) for x in ans]))

main()
# print(main())


### FIXED CODE ###

import math,itertools,fractions,heapq,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  ans=[0]*n

  ind=n
  for i in range(n):
    sm=0
    for j in range(2,n+1):
      if ind*j>n:
        break
      else:
        sm+=ans[ind*j-1]
    ans[ind-1]=(l[ind-1]+sm)%2
    ind-=1
    # print(ans,ind)

  # print(ans)

  _ans=[]
  for i,x in enumerate(ans):
    if x==1:
      _ans.append(i+1)

  ln=len(_ans)
  print(ln)
  if ln!=0:
    print(' '.join([str(x) for x in _ans]))

main()
# print(main())
a, b, c = [int(i) for i in input().split()]
if x%2 == 1 or y%2 == 1 or z%2 == 1:
    print(0)
elif a == b and b == c:
    print(-1)
else:
    x = a
    y = b
    z = c
    cnt = 0
    while True:
        if x%2 == 1 or y%2 == 1 or z%2 == 1:
            break
        else:
            x, y, z = y//2 + z//2, x//2 + z//2, x//2 + y//2
            cnt += 1

    print(cnt)

### FIXED CODE ###

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


if a%2 == 1 or b%2 == 1 or c%2 == 1:
    print(0)
elif a == b and b == c:
    print(-1)
else:
    x = a
    y = b
    z = c
    cnt = 0
    while True:
        if x%2 == 1 or y%2 == 1 or z%2 == 1:
            break
        else:
            x, y, z = y//2 + z//2, x//2 + z//2, x//2 + y//2
            cnt += 1

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

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min1 = 0
max1 = max(A)

while True:
    X = (min1 + max1)//2
    for i in range(N):
        if A[i] % X == 0:
            d[i] = A[i]//X - 1
        else:
            d[i] = A[i]//X
    if sum(d) <= K:
        max1 = X 
    else:
        min1 = X
    print(min1, max1)

    if max1 - min1 <= 1:
        print(int(max1))
        break


### FIXED CODE ###

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

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min1 = 0
max1 = max(A) + 1

while True:
    X = (min1 + max1)//2
    for i in range(N):
        if A[i] % X == 0:
            d[i] = A[i]//X - 1
        else:
            d[i] = A[i]//X
    if sum(d) <= K:
        max1 = X 
    else:
        min1 = X
    #print(min1, max1)

    if max1 - min1 <= 1:
        print(int(max1))
        break
N=int(input())
A=list(map(int,input().split()))
 
A=sorted(A,reverse=True)
if(len(A)%2==1):
    A.append(0)
c=0
l=1
for i in range(0,len(A)+1,2):
    if(c==2):
        break
    elif(A[i]==A[i+1]):
        c+=1
        l*=A[i]
if(c==2):
    print(l)
else:
    print(int(0))

### FIXED CODE ###

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

A=sorted(A,reverse=True)
if(len(A)%2==1):
    A.append(0)
c=0
l=1
t=0
th=0
for i in range(0,len(A),2):
    if(c==2):
        break
    if(A[i]==A[i+1]):
        c+=1
        l*=A[i]
        th=True
    elif(t==A[i] and not(th)):
        c+=1
        l*=A[i]
        th=False
    else:
        th=False
    t=A[i+1]
if(c==2):
    print(l)
else:
    print(0)
import math
from functools import reduce

n = int(input())
a_list = list(map(int, input().split()))
max = a_list[-1] + 1
memo = [0] * max

for a in a_list:
    memo[a] += 1

for i in range(2, max):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")


### FIXED CODE ###

import math
from functools import reduce
L = 10**6 + 1
n = int(input())
a_list = list(map(int, input().split()))
memo = [0] * L

for a in a_list:
    memo[a] += 1

for i in range(2, L):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")
input_data = input()
if input_data <= 999:
    print('ABC')
print('ABD')

### FIXED CODE ###

input_data = int(input())
if input_data <= 999:
    print('ABC')
else:
    print('ABD')
S = list(input())
N = int(input())

'''
ordの位置
#z = 122
#a = 97
左の文字からNで'a'に出来るかを確認
aに出来るならaにして使った分をNから引く
繰り返して行き一番最後にあまりをすべて使う'''
  
for i, s in enumerate(S):
  if ord(s) - 97 > 0  and 122 - ord(s) < N:
    S[i] = "a"
    N -= 123 - ord(s)
else:
  S[i] = chr((ord(S[i]) + N))
  
print("".join(S))

### FIXED CODE ###

S = list(input())
N = int(input())

'''
ordの位置
#z = 122
#a = 97
左の文字からNで'a'に出来るかを確認
aに出来るならaにして使った分をNから引く
繰り返して行き一番最後にあまりをすべて使う
'''
  
for i, s in enumerate(S):
  if ord(s) - 97 > 0  and 122 - ord(s) < N:
    S[i] = "a"
    N -= 123 - ord(s)
else:
  S[i] = chr(N % 26 + ord(S[i])) # ここのWAは反省する
       
print("".join(S))
from collections import Counter

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

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

if Vodd == Veven:
    print(n // 2)


Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt += 0
    Vec_cnt += 0
    num += max(Voc_val[1] - Voc_val[0], Vec_val[1] - Vec_val[0])

print(n - num)


### FIXED CODE ###

from collections import Counter

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

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_cnt[1] - Voc_cnt[0], Vec_cnt[1] - Vec_cnt[0])

print(n - num)
N = int(input())
a = list(map(int, input().split()))

res = [0] * 100000

for i in a:
	list[i] += 1
	
print(max(map(sum,zip(list, list[1:], list[2:]))))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
 
res = [0] * 100000
 
for i in a:
	res [i] += 1
	
print(max(map(sum,zip(res , res [1:], res [2:]))))
rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))

doubles = [d1 == d2 for d1,d2 in dices]

for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if double[i] == 3:
    print('Yes')
    exit()

print('No')




### FIXED CODE ###

rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))
 
doubles = [d1 == d2 for d1,d2 in dices]
 
for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if doubles[i] == 3:
    print('Yes')
    exit()
 
print('No')
import fractions
from functools import reduce

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

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

b = lcm_list(a)

m -= int((b/2))
if m < 0:
    print(0)
    exit()

ans = (m//b) + 1
print(int(ans))

### FIXED CODE ###

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

from fractions import gcd
from functools import reduce

a = [i >> 1 for i in a]

def applied_lcm(x, y):
    g = gcd(x, y)
    x //= g
    y //= g
    if x %2 == 0:
        return 0
    if y %2 == 0:
        return 0
    n = x * y * g
    if n >> 10**9:
        return 0

    return n

p = reduce(applied_lcm, a)
if p == 0:
    ans = 0
else:
    ans = (m//p) - (m//(p+p))
print(ans)
import sys
import numpy as np

readline = sys.stdin.readline

n = int(input())
a = np.array(readline().split(),dtype=np.int64)
b = np.array(readline().split(),dtype=np.int64)
c = np.array(readline().split(),dtype=np.int64)

ans = 0
for i in range(n):
    ans += np.count_nonzero(a < b[i]) * np.count_nonzero(c > b[i])
print(ans)


### FIXED CODE ###

c1 = list(input())
c2 = list(input())
ans = "YES" if c2 == c1[::-1] else "NO"
print(ans)
list = input().split(" ")
N = int(list[0])
K = int(list[1])
list_hp = input().split(" ")
list_hp = [int(i) for i in list_hp]
list_hp = sorted(list_hp,reverse=True)

if K < N:
    for i in range(K):
        list_hp.pop(0)
    print(sum(list_hp))
    
else:
    print(0)

### FIXED CODE ###

list = input().split(" ")
H = int(list[0])
A = int(list[1])

t = 0
while H > 0:
    H = H - A
    t = t + 1

print(t)
K, N = map(int, input().split())
A = list(map(int, input().split()))
B = [0] * N
count = 0
for i in A:
  count += 1
  if count < N:
    B[i]=A[i+1]-A[i]
  else:
    B[N-1] = A[0] + K - A[N-1]

print(K-max(B))


### FIXED CODE ###

K, N = map(int, input().split())
A = list(map(int, input().split()))
B = [0] * N
k = 0
for i in A:
  k += 1
  if k != N:
    B[k-1]=A[k]-A[k-1]
  else:
    B[N-1] = A[0] + K - A[N-1]

print(K-max(B))
Weiht = list(map(int, input().split()))
if (Weight[0] + Weight[1]) > (Weight[2] + Weight[3]):
    print("Left")
elif (Weight[0] + Weight[1]) < (Weight[2] + Weight[3]):
    print("Right")
else:
    print("Balanced")


### FIXED CODE ###

Weight = list(map(int, input().split()))
if (Weight[0] + Weight[1]) > (Weight[2] + Weight[3]):
    print("Left")
elif (Weight[0] + Weight[1]) < (Weight[2] + Weight[3]):
    print("Right")
else:
    print("Balanced")
n=int(input())
a,b,c=input().split()
ab,bc,ca=0,0,0
for i in range(n):
  if a[i]!=b[i]:
    ab+=1
  if b[i]!=c[i]:
    bc+=1
  if c[i]!=a[i]:
    ca+=1
print(min(ab,bc,ca))

### FIXED CODE ###

n=int(input())
a=input();b=input();c=input()
x=0
for i in range(n):
  x+=len(list(set([a[i],b[i],c[i]])))-1
print(x)