Harryxun/stf_run huggingface dataset:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
for i in range(N+1):
    if total<=X:
        total+=L[i]
        count+=1
    else:
        break
print(count)

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=1
for i in range(N):
    total+=L[i]
    if total<=X:
        count+=1
print(count)
import numpy as np
number=input().rstrip().split(' ')

N=int(number[0])
M=int(number[1])
judge=np.zeros([N-1,N],dtype=np.int16)

for i in range(M):
    cities=input().rstrip().split(' ')
    A=int(cities[0])
    B=int(cities[1])
    judge[A-1][B-1]=1
    
print(np.count_nonzero(np.all(judge==0,axis=1)))

### FIXED CODE ###

from networkx import *
 
n,m = map(int, input().split())
G = Graph()
 
for i in range(m):
    a,b = map(int, input().split())
    G.add_edges_from([(a, b)])
 
m3 = list(connected_components(G))

count = 0
 
if len(max(connected_components(G), key=len)) == n:
    print(0)
    exit()
else:
    for i in m3:
        count += len(i)
 
sub = n - count
 
print((len(m3)-1)+sub)
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(a: int, b: int, c: int):
    from math import sqrt, log10
    from fractions import Fraction

    fa = Fraction(sqrt(a)+sqrt(b), 20)
    fc = Fraction(sqrt(c), 20)
    if round(sqrt(a)+sqrt(b), 10) < round(sqrt(c), 10):
    # if fa < fc:
        print(YES)
    else:
        print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    solve(a, b, c)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(a: int, b: int, c: int):
    from decimal import Decimal
    from math import sqrt
    a,b,c = Decimal(a), Decimal(b), Decimal(c)

    if a.sqrt() + b.sqrt() < c.sqrt():
        print(YES)
    else:
        print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    solve(a, b, c)

if __name__ == '__main__':
    main()
from functools import reduce
from operator import mul
N = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
lis = sorted(prime_factorize(N))
print(0, 0, 0, lis[0], reduce(mul, lis[1:]), 0)



### FIXED CODE ###

import math
S = int(input())
 
x1 = math.ceil(math.sqrt(S))
y1 = 1
x2 = x1 ** 2 - S
y2 = x1
x3 = 0
y3 = 0
 
print(x1, y1, x2, y2, x3, y3)
flg = 1
i=0
while flg:
    i=i+1
    Indata = input()
    print("Case" +str(i) + ": " + str(Indata))
    if Indata == 0:
        flg=0
    



### FIXED CODE ###

i=0
while True:
    Indata = int(input())
    if Indata == 0:
        break
    else:
        i=i+1
        print("Case " +str(i) + ": " + str(Indata))
n = int(input())
 
a = []
b = []
 
 
for i in range(1, n):
    if n%i == 0:
        a.append(i)
        b.append(int(n/i))
 
a = list(map(str, a))
b = list(map(str, b))
 
 
result = []
for i in range(len(a)):
    result.append(max(len(a[i]), len(b[i])))
 
print(min(result))

### FIXED CODE ###

N = int(input())

import math
N_sqrt = int(math.sqrt(N))

A = [i for i in range(1, N_sqrt+1) if N%i == 0]

print(len(str(N // A[-1])))
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)
#import numpy as np
#import math
import heapq

n, m = map(int, input().split())
#a = list(map(int, input().split()))
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    MAX = heapq.heappop(a)  # −１かけたリストのMin　＞Max
    heapq.heappush(a, (-1) * (-MAX // 2))
    print(a)

ans = (sum(a)) * (-1)  # そのままリストでOK
print(ans)

### FIXED CODE ###

#import numpy as np
#import math
import heapq

n, m = map(int, input().split())
#a = list(map(int, input().split()))
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    MAX = heapq.heappop(a)  # −１かけたリストのMin　＞Max
    heapq.heappush(a, (-1) * (-MAX // 2))

ans = (sum(a)) * (-1)  # そのままリストでOK
print(ans)
a,b,k = map(int,input().split())
1 1 1

number = 0
for i in range(min(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        number += 1
        if number == k:
            print(i)
            break


### FIXED CODE ###

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

number = 0
for i in range(min(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        number += 1
        if number == k:
            print(i)
            break
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))
a, b = map(int, input().split())
s = input()
if(len(s) != a+b+1 or s[a] != '-'):
	print('No')
	sys.exit()
print('Yes')

### FIXED CODE ###

import sys
a, b = map(int, input().split())
s = input()
if(s.count('-') == 1 and s[a] == '-'):
	print('Yes')
	sys.exit()
print('No')
# 2020/05/02
# AtCoder Beginner Contest 165 - C

a = list()
def mkArray(in_list, sav_val, cnt):
    if cnt >= m - 1:
        a.append(in_list)
        return 0
    else:
        for x in range(sav_val, m + 1):
            wk_list = list()
            wk_list.extend(in_list)
            wk_list.append(x)
            mkArray(wk_list, x, cnt + 1)

# Input
n, m, q = map(int,input().split())
abcd = list()

for i in range(q):
    w_abcd = list(map(int,input().split()))
    abcd.append(w_abcd)

# Make Array
w_a = list()
mkArray(w_a, 1, 0)

# Search
ans = 0
for i in range(len(a)):
    wans = 0
    for j in range(q):
        if a[i][abcd[j][1]-1] - a[i][abcd[j][0]-1] == abcd[j][2]:
            wans = wans + abcd[j][3]

    if wans > ans:
        ans = wans

# Output
print(ans)


### FIXED CODE ###

# 2020/05/02
# AtCoder Beginner Contest 165 - C

a = list()
def mkArray(in_list, sav_val, cnt):
    if cnt >= n:
        a.append(in_list)
        return 0
    else:
        for x in range(sav_val, m + 1):
            wk_list = list()
            wk_list.extend(in_list)
            wk_list.append(x)
            mkArray(wk_list, x, cnt + 1)

# Input
n, m, q = map(int,input().split())
abcd = list()

for i in range(q):
    w_abcd = list(map(int,input().split()))
    abcd.append(w_abcd)

# Make Array
w_a = list()
mkArray(w_a, 1, 0)

# Search
ans = 0
for i in range(len(a)):
    wans = 0
    for j in range(q):
        if a[i][abcd[j][1]-1] - a[i][abcd[j][0]-1] == abcd[j][2]:
            wans = wans + abcd[j][3]

    if wans > ans:
        ans = wans

# Output
print(ans)
# --- coding: utf-8 ---

a, b = map(int, input().split())
if a * b % 2 = 0:
  return "Even"
else:
  return "Odd"

### FIXED CODE ###

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

c = a * b
d = c % 2
if d == 0:
  print("Even")
else:
  print("Odd")
s=input()
 
m=s//60
h=m//60
s=s%60
 
print("{}:{}:{}".format(h,m,s))


### FIXED CODE ###

s = int(input())

m = s // 60
h = m // 60
m = m % 60
s = s % 60

output=""
output+=str(h)
output+=":"
output+=str(m)
output+=":"
output+=str(s)

print(output)
while True:
	a,op,b=map(str,input()split())
	if op == "+":
		s=int(a)+int(b)
	elif op =="-":
		s=int(a)-int(b)
	elif op =="*":
		s=int(a)*int(b)
	elif op =="/":
		s=int(a)//int(b)
	else:
		break
print(s)


### FIXED CODE ###

while True:
	a,op,b=input().split()
	if op == "+":
		print(int(a)+int(b))
	elif op =="-":
		print(int(a)-int(b))
	elif op =="*":
		print(int(a)*int(b))
	elif op =="/":
		print(int(a)//int(b))
	else:
		break
S=str(input())
list_ = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(S)):
  if len([1 for s in list_ if s==S[i]])>0:
    n=list_.index(S[i])
    list_ = list_[:n] + list_[n + 1:]
print(list_[0])

### FIXED CODE ###

import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])
N, K = map(int, input().split())
P = list(map(int, input().split()))
# print(P)
E = [(p*(p+1))/(2*p) for p in P]
print(max([sum(E[i:i+K]) for i in range(N-K)]))


### FIXED CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))
# print(P)
E = [(p*(p+1))/(2*p) for p in P]
# print([sum(E[i:i+K]) for i in range(N-K+1)])
S = [0]
for i in range(N):
    S.append(S[i] + E[i])
print(max([S[i+K] - S[i] for i in range(N-K+1)]))
#M num of prefecture
#N num of city
N, M = map(int,input().split())
#P pref
#Y year
P=[]
Y=[]
cities=[]
for i in range(M):
    try:
        s = input()
        p,y = s.split()
        city=(p,y)
        cities.append(city) 
        P.append(p)
        Y.append(y)
    except:
        break

sort_city=sorted(cities,key=lambda x:(x[0],x[1]))
prefs = sorted(set(P))

address=[]
res=[]
for i in range(len(sort_city)): 
    address=str(sort_city[i][0]).rjust(6,'0')+str(i+1).rjust(6,'0')
    res.append((sort_city[i],address))

print(res[1][0])
for i in range(len(cities)):
    for j in range(len(res)):
        if cities[i] == res[j][0]:
            print(res[j][1])



### FIXED CODE ###

n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
s=[]
for i in enumerate(l):
    s.append(i)
s=sorted(s,key=lambda x:(x[1][0],x[1][1]))
a=0
for i in range(m):
    if s[i][1][0]==0:
       a=1     
    elif s[i][1][0]==s[i-1][1][0]:
        a+=1
    elif s[i][1][0]!=s[i-1][1][0]:
        a=1
    s[i][1][1]=a
s = sorted(s,key=lambda x:x[0])
for i in s:
    print('%06d'%i[1][0]+'%06d'%i[1][1])
K = int(input())

X = 10
ans = 1    
while ans <= L:
    L = 9*K/7
    x = X%L
    if x == 1:
        print(ans)
        break
    else:
        ans += 1
        X = x*10 

if x != 1:
    print(-1) 

### FIXED CODE ###

K = int(input())

ans = 1
X = 7
cnt = K
while ans <= K:
    x = X % K
    if x == 0:
        print(ans)
        break
    else:
        ans += 1
        X = x*10 + 7 

if x != 0:
    print(-1)
L = [0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]

x, y = map(int, intput().split())

print(["Yes", "No"] [L(x) == l(y)])


### FIXED CODE ###

L = [0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]

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

print(["No", "Yes"] [L[x] == L[y]])
N=int(input())
def f(N):
	for i in range(1,10):
  		for j in range(1,10):
    		if i*j==N:
              return(True)
   	return(False)
if f(N):
  print("YES")
else:
  print("NO")
      

### FIXED CODE ###

N=int(input())
def f(N):
  for i in range(1,10):
    j=N//i
    if i*j==N and (j>=1 and j<=9):
      return(True)
  return(False)
if f(N):
  print("Yes")
else:
  print("No")
import sys

def f(pos, S, step, R, goal):
    i, j = pos[0], pos[1]
    if i >= goal[0]+1 or i < 0 or j >= goal[1]+1 or j < 0:
        return 10**5
    if S[i][j]:
        return 10**5
    if pos == goal:
        return step

    if step > R[i][j]:
        return 10**5
    else:
        R[i][j] = step
        return min(f([i+1, j], S, step+1, R, goal),
                   f([i-1, j], S, step+1, R, goal),
                   f([i, j+1], S, step+1, R, goal),
                   f([i, j-1], S, step+1, R, goal))

def main():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    S = []
    init = 0
    for _ in range(H):
        s = [c == '#' for c in input().strip()]
        init += sum(s)
        S.append(s)
    R = [[10**5 for _ in range(W)] for _ in range(H)]
    R[0][0] = 1
    minstep = f([0,0], S, 1, R, [H-1, W-1])
    if minstep == 10**5:
        print(-1)
    else:
        print(H*W - minstep - init)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def wfs(queue, S, step, goal):
    next_queue = set()
    for q in queue:
        if q == goal:
            return step+1

        i, j = q[0], q[1]
        S[i][j] = '#'

        if S[i+1][j] == '.':
            next_queue.add((i+1, j))
        if S[i-1][j] == '.':
            next_queue.add((i-1, j))
        if S[i][j+1] == '.':
            next_queue.add((i, j+1))
        if S[i][j-1] == '.':
            next_queue.add((i, j-1))

    if len(next_queue) == 0:
        return -1
    else:
        next_queue = list(set(next_queue))
        return wfs(next_queue, S, step+1, goal)


def main():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    S = []
    black = 0
    for _ in range(H):
        s = [c for c in input().strip()]
        black += sum([c == '#' for c in s])
        S.append(['#'] + s + ['#'])
    S = [['#'] * (W+2)] + S + [['#'] * (W+2)]
    init = set([(1, 1)])
    minstep = wfs(init, S, 0, (H, W))
    if minstep == -1:
        print(-1)
    else:
        print(H*W - minstep - black)


if __name__ == '__main__':
    main()
def count_dot(lis):
    c=0
    for i in lis:
        if not(i=='.'):
            return c
        c+=1

def solve(N):
    a=[]
    dot =[]
    for i in range(N):
        a.append([char for char in input()])
        dot.append(count_dot(a[i]))

    for i in range(N):
        for j in range(len(a[i])):
            if a[i][j]=='.':
                a[i][j]=' '

    for i in range(1,N):
        #print(type(dot[i]))
        a[i][dot[i-1]]='+'
        k=1
        while True:
            if not(a[i-k][dot[i]] == ' '):
                break
            a[i-k][dot[i]]='|'
            k += 1
    for i in range(N):
        for char in a[i]:
            print(char,end='')
        print()

while True:
    N=int(input())
    if N==0:
        break
    solve(N)



### FIXED CODE ###

def count_dot(lis):
    c=0
    for i in lis:
        if not(i=='.'):
            return c
        c+=1

def solve(N):
    a=[]
    dot =[]
    for i in range(N):
        a.append([char for char in input()])
        dot.append(count_dot(a[i]))

    for i in range(N):
        for j in range(len(a[i])):
            if a[i][j]=='.':
                a[i][j]=' '

    for i in range(1,N):
        #print(type(dot[i]))
        a[i][dot[i]-1]='+'
        k=1
        while True:
#            print(i-k,dot[i]-1)
            if a[i-k][dot[i]-1] == ' ':
                a[i-k][dot[i]-1]='|'
                k += 1
            else:
                break

    for i in range(N):
        for char in a[i]:
            print(char,end='')
        print()

while True:
    N=int(input())
#    print(N)
    if N==0:
        break
    solve(N)
n, max_dist = int(input())
points = 0

for _ in range(n):
  x, y = int(input())
  dist = sqrt(x * x + y * y)
  
  if dist <= max_dist:
    points += 1
	
print(points)

### FIXED CODE ###

import math

n, max_dist = input().split()

points = 0

for _ in range(int(n)):
    x, y = input().split()
    x = int(x)
    y = int(y)

    dist = math.sqrt(x * x + y * y)

    if dist <= float(max_dist):
        points += 1

print(points)
import math
A,B = map(int,input().split(" "))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A,B))

### FIXED CODE ###

import fractions
A,B = map(int,input().split(" "))
print(int((A * B) / fractions.gcd(A, B)))
from collections import deque


def transaction(N, r):
    if len(r) == 0:
        return N
    x = r[0]
    n = int(N / x[1])
    if N % x[1] == 0 or len(r) == 1:
        return n * x[2]
    r.popleft()
    s = N
    for i in range(n + 1):
        tmp = i * x[2] + transaction(N - i * x[1], r)
        if tmp > s:
            s = tmp
    return s

N = int(input())
A = [int(e) for e in input().split()]
B = [int(e) for e in input().split()]

r = []
for i in range(3):
    (a, b) = (A[i], B[i])
    if b > a:
        r.append((b / a, a, b))

r.sort(reverse=True)
dr = deque(maxlen=3)
for x in r:
    dr.append(x)
N = transaction(N, dr)

r = []
for i in range(3):
    (a, b) = (A[i], B[i])
    if a > b:
        r.append((a / b, b, a))

r.sort(reverse=True)
dr.clear()
for x in r:
    dr.append(x)

print(transaction(N, r))


### FIXED CODE ###

import math
import sys

N = int(input())
GA, SA, BA = list(map(int, input().split()))
GB, SB, BB = list(map(int, input().split()))

def knapsack(n, ga, sa, ba, gb, sb, bb):
    values = []
    weights = []
    if gb / ga > 1:
        values.append(gb - ga)
        weights.append(ga)
    if sb / sa > 1:
        values.append(sb - sa)
        weights.append(sa)
    if bb / ba > 1:
        values.append(bb - ba)
        weights.append(ba)
    if len(values) == 3:
        # dp[i]: 重さ i 以下で選ぶのの価値の最大値
        dp = [0] * (n + 1)
        dp[0] = n
        for i in range(1, n + 1):
            x = dp[i - 1]
            for w, v in zip(weights, values):
                if i - w >= 0:
                    x = max(x, dp[i - w] + v)
            dp[i] = x
        return dp[n]
    if len(values) == 2:
        w1, w2 = weights
        v1, v2 = values
        if (v1 + w1) / w1 < (v2 + w2) / w2:
            v1, v2 = v2, v1
            w1, w2 = w2, w1
        c1 = n // w1
        c2 = (n - w1 * c1) // w2
        ret = n + v1 * c1 + v2 * c2
        while c1 >= 0:
            a = n - w1 * c1 - w2 * c2
            c1 -= max(1, math.ceil((w2 - a) / w1))
            c2 = (n - w1 * c1) // w2
            ret = max(ret, n + v1 * c1 + v2 * c2)
            if w1 * c1 + w2 * c2 == n:
                break
        return ret
    if len(values) == 1:
        return n + n // weights[0] * values[0]
    return n

ans = knapsack(N, GA, SA, BA, GB, SB, BB)
ans = knapsack(ans, GB, SB, BB, GA, SA, BA)
print(int(ans))
n=input()
print"",
for i in range(n+1):
  if i%3==0 or str(i).count('3'):
  print i,

### FIXED CODE ###

n=input()
print"",
for i in range(1,n+1):
  if i%3==0 or str(i).count('3'):print i,
while x != 0 or y != 0:
    x, y = sorted(map(int, input().split()))
    print(x, y)
    x,y = sorted(map(int, input().split()))


### FIXED CODE ###

while True :
    x, y = sorted(map(int, input().split()))
    if x == y and y == 0 : break
    print(x, y)
from collections import deque
import sys
sys.setrecursionlimit(20000000)
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N-1)]
routes = [[] for _ in range(N-1)]

for i in range(len(ab)):
    routes[ab[i][0]-1].append([ab[i][1]-1, i])
    routes[ab[i][1]-1].append([ab[i][0]-1, i])

route_color = [-10e+10 for _ in range(len(ab))]

route_num = [0]*N
max_route = 0
for i in range(N):
    num = len(routes[i])
    route_num[i] = num
    if max_route < num:
        max_route = num

seen = [False for _ in range(N)]

def function(num):
    seen[num] = True
    colors = set(range(max_route))
    for route in routes[num]:
        if route_color[route[1]] != -10e+10:
            colors.remove(route_color[route[1]])
        else:
            route_color[route[1]] = colors.pop()
        if seen[route[0]] == False:
            function(route[0])
    return

function(0)
print(max_route)
for color in route_color:
    print(color+1)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(20000000)

N = int(input())
ab = [list(map(int, input().split())) for _ in range(N-1)]
routes = [[] for _ in range(N)]

for i in range(len(ab)):
    routes[ab[i][0]-1].append([ab[i][1]-1, i])
    routes[ab[i][1]-1].append([ab[i][0]-1, i])

route_color = [-10e+10 for _ in range(len(ab))]

route_num = [0]*N
max_route = 0
for i in range(N):
    num = len(routes[i])
    route_num[i] = num
    if max_route < num:
        max_route = num

seen = [False for _ in range(N)]

def function(num,pre_color):
    color_num = -1
    for route in routes[num]:
        color_num += 1
        if color_num == pre_color:
            color_num+=1
        if route_color[route[1]] != -10e+10:
            color_num-=1
            pass
        else:
            route_color[route[1]] = color_num
            
        if seen[route[0]] == False:
            seen[route[0]] = True
            function(route[0],route_color[route[1]])
    return

function(0,-1)
print(max_route)
for color in route_color:
    print(color+1)
import math

N = int(input())
A = list(map(int,input()))
B = []
M = math.ceil(math.log(N,2)) 

for i in range(N):
  a = 0
  for j in range(1,M+1,1):
    a += math.floor((N-1)/(2**j))-math.floor((i)/(2**j))-math.floor((N-1-i)/(2**j))
  if a == 0:
    B.append(1)
  else:
    B.append(0)
    
b = 0
for i in range(N):
  b += B[i]*A[i]
if b % 2 == 1:
  print(1)
else:
  for i in range(N):
    if A[i] == 2:
      print(0)
      break
  else:
    for i in range(N):
      A[i] = (A[1]-1)//2
    for i in range(N):
      a = 0
      C = []
      for j in range(1,M+1,1):
        a += math.floor((N-1)/(2**j))-math.floor((i)/(2**j))-math.floor((N-1-i)/(2**j))
      if a == 0:
        C.append(1)
      else:
        C.append(0)
    
    for i in range(N):
      b += C[i]*A[i]
    if b % 2 == 1:
      print(2)
    else:
      print(0)

### FIXED CODE ###

import math

N = int(input())
A = list(map(int,input()))
B = []

for i in range(N):
  if N-1 == (i|N-1-i):
    B.append(1)
  else:
    B.append(0)
    
b = 0
for i in range(N):
  b += B[i]*A[i]
if b % 2 == 1:
  print(1)
else:
  for i in range(N):
    if A[i] == 2:
      print(0)
      break
  else:
    c = 0
    for i in range(N):
      A[i] = (A[i]-1)//2
      c += B[i]*A[i]
    if c % 2 == 1:
      print(2)
    else:
      print(0)
import sys
n, y = map(int, input().split())
sys.setrecursionlimit(2000)


def calc(a, b, c):
    return 10000 * a + 5000 * b + 1000 * c


def dfs(pos, a, b, c):
    if pos == n:
        if calc(a, b, c) == y:
            return [a, b, c]
        else:
            return [-1, -1, -1]
    ret1 = [
        dfs(pos+1, a+1, b, c),
        dfs(pos+1, a, b+1, c),
        dfs(pos+1, a, b, c+1)
        ]
    ret1.sort(key=lambda x: x[0])
    return ret1[-1]


print(*dfs(0, 0, 0, 0))

### FIXED CODE ###

import sys
n, price = map(int, input().split())
ans = [-1, -1, -1]
for x in range(n+1):
    for y in range(n+1):
        z = n - x - y
        if z < 0:
            continue
        if 10000 * x + 5000 * y + 1000 * z == price:
            ans = [x, y, z]
            print(*ans)
            sys.exit()
print(*ans)
import random
i=input()
rl=[random.randint(0,len(i))for i in range(3)]
result = ""
for j in rl:
  result = result + i[j]
print(result)


### FIXED CODE ###

import random
S=input()
r = random.randint(0,len(S)-3)
result =""
result = S[r]+S[r+1]+S[r+2]
print(result)
from collections import Counter
 
n = int(input())
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

v_odd_common.append((0,0))
v_even_common.append((0,0))

if v_odd_common[0] != v_even_common[0]:
    print(n-v_odd_common[0][1]-v_even_common[0][1])
else:
    print(min(n-v_odd_common[0][1]-v_even_common[1][1],n-v_odd_common[1][1]-v_even_common[0][1])

### FIXED CODE ###

from collections import Counter
 
n = int(input())
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

v_odd_common.append((0,0))
v_even_common.append((0,0))

if v_odd_common[0] != v_even_common[0]:
    print(n-v_odd_common[0][1]-v_even_common[0][1])
else:
    print(min(n-v_odd_common[0][1]-v_even_common[1][1],n-v_odd_common[1][1]-v_even_common[0][1]))