Harryxun/stf_run huggingface dataset:
n=int(input())
def recuur(g,x,y,z):
     global n

     if z==n-1:
        return y
     if x==1:
         return y+max(recuur(g,2,g[z+1][2],z+1),recuur(g,0,g[z+1][0],z+1))
     if x==2:
         return y+max(recuur(g,1,g[z+1][1],z+1),recuur(g,0,g[z+1][0],z+1))
     if x==0:
         return y+max(recuur(g,2,g[z+1][2],z+1),recuur(g,1,g[z+1][1],z+1))

g=[[0,0,0] for _ in range(n)]
for u in range(n):
    a,b,c=map(int,input().split())
    g[u][1],g[u][2],g[u][0]=b,c,a
dp=[ [0,0] for _ in range(n)]
dp[0]=[max(g[0]),g[0].index(max(g[0]))]
print(recuur(g,dp[0][1],dp[0][0],0))

### FIXED CODE ###

n=int(input())
a=[[0,0,0] for _ in range(n)]
for j in range(n):
  a[j][0],a[j][1],a[j][2]=map(int,input().split())
dp=[[0,0,0] for _ in range(n)]
dp[0][0]=a[0][0]
dp[0][1]=a[0][1]
dp[0][2]=a[0][2]
for i in range(1,n):
    dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2])
    dp[i][1] = a[i][1] + max(dp[i - 1][0], dp[i - 1][2])
    dp[i][2] = a[i][2] + max(dp[i - 1][1], dp[i - 1][0])
print(max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2])))
N, M=map(int, input().split())
solved=[False]*N
ac=0
wa=0
for _ in range(M):
  p, s=input().split()
  p=int(p)-1
  if solved[p]:
    continue
  if s=="AC":
    solved[p]=True
    ac+=1
  else:
    wa+=1
print(as, wa)  

### FIXED CODE ###

N, M=map(int, input().split())
solved=[False]*N
wal=[0]*N
ac=0
wa=0
for _ in range(M):
  p, s=input().split()
  p=int(p)-1
  if solved[p]:
    continue
  if s=="AC":
    solved[p]=True
    ac+=1
    wa+=wal[p]
  else:
    wal[p]+=1
print(ac, wa)
from collections import deque
H, W = map(int, input().split())
route = []
n_black = 0
for _ in range(H):
  tmp_ls = list(map(int, input().split()))
  n_black += tmp_ls.count("#")
  route.append(tmp_ls)
visited = [[False]*W for _ in range(H)]
dist = [[-1]*W for _ in range(H)]
dist[0][0] = 0
tmp = [0,0]
goal = [H-1, W-1]
kouho = deque()
def rinsetsu(ls):
  x, y = ls[0], ls[1]
  ans = []
  if x-1 >= 0:
    if y-1 >= 0:
      ans.append([x-1, y-1])
    if y+1 <= W-1:
      ans.append([x-1, y+1])
  if x+1 <= H-1:
    if y-1 >= 0:
      ans.append([x+1, y-1])
    if y+1 <= W-1:
      ans.append([x+1, y+1])
  return ans
for ls in rinsetsu([0,0]):
  if route[ls[0]][ls[1]] == ".":
    kouho.append([ls[0], ls[1], 0, 0])
def bfs():
  while True:
    while True:
      tmp = kouho.popleft()
      if not vivited[[tmp[0]][tmp[1]]:
        break
      if len(kouho) == 0:
        return
    x, y = tmp[0], tmp[1]
    visited[x][y] = True
    dist[x][y] = dist[tmp[2]][tmp[3]] + 1
    if [x, y] == goal:
      return
    for ls in rinsetsu([x,y]):
      if not visited[ls[0]][ls[1]] and route[ls[0]][ls[1]] = ".":
        kouho.append(ls + [x, y])
bfs()
if dist[H-1][W-1] == -1:
  print(-1)
else:
  white = dist[H-1][W-1] + 1
  print(H*W - white - n_black)

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
route = []
n_black = 0
for _ in range(H):
  tmp_ls = input()
  n_black += tmp_ls.count("#")
  route.append(tmp_ls)
visited = [[False]*W for _ in range(H)]
dist = [[-1]*W for _ in range(H)]
dist[0][0] = 0
tmp = [0,0]
goal = [H-1, W-1]
kouho = deque()
def rinsetsu(ls):
  x, y = ls[0], ls[1]
  ans = []
  if x-1 >= 0:
    ans.append([x-1, y])
  if x+1 <= H-1:
    ans.append([x+1, y])
  if y-1 >= 0:
    ans.append([x, y-1])
  if y+1 <= W-1:
    ans.append([x, y+1])
  return ans
for ls in rinsetsu([0,0]):
  if route[ls[0]][ls[1]] == ".":
    kouho.append([ls[0], ls[1], 0, 0])
def bfs():
  while True:
    while True:
      if len(kouho) == 0:
        return
      tmp = kouho.popleft()
      if not visited[tmp[0]][tmp[1]]:
        break
    x, y = tmp[0], tmp[1]
    visited[x][y] = True
    dist[x][y] = dist[tmp[2]][tmp[3]] + 1
    if [x, y] == goal:
      return
    for ls in rinsetsu([x,y]):
      if not visited[ls[0]][ls[1]] and route[ls[0]][ls[1]] == ".":
        kouho.append(ls + [x, y])
bfs()
if dist[H-1][W-1] == -1:
  print(-1)
else:
  white = dist[H-1][W-1] + 1
  print(H*W - white - n_black)
n=int(input())
s=input()
x=0
max=0
for i in range(n):
  if(s[i]=="D"):
    x-=1
  else:
    x+=1
    max=max([max,x])
print(max)

### FIXED CODE ###

n=int(input())
s=input()
x=0
ma=0
for i in range(n):
  if(s[i]=="D"):
    x-=1
  else:
    x+=1
    ma=max([ma,x])
print(ma)
l,r,d=map(int,input().split)
print((r-l)//d)


### FIXED CODE ###

l,r,d=map(int,input().split())
print(r//d-(l-1)//d)
from collections import*
c=Counter.most_common
n=int(input())
n_l =[input() for i in range(n)]
m=int(input())
m_l =[input() for i in range(m)]
d=n_l.c()[0][1]-m_l.c()[-1][1]
if d <=0:print(0)
else:print(d)

### FIXED CODE ###

n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(m)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))
N = int(input())

if N< 1200:
  print ("ABC")
elsif N< 2800:
  print ("ARC")
else:
  print ("AGC")

### FIXED CODE ###

N = int(input())

if N < 1200:
  print ("ABC")
elif N < 2800:
  print ("ARC")
else:
  print ("AGC")
N,Q = map(int, input().split())
S = input()
for i in range(Q):
  l, r = map(int, input().split())
  s = S.copy()
  ss = s[l-1:r]
  print(ss)


### FIXED CODE ###

import sys
sy = sys.stdin.readlines()
N,Q = map(int, sy[0].split())
S = sy[1]
ACindex = [0 for _ in range(N+1)]
count = 0
for n in range(1, N):
  if S[n-1]=="A" and S[n]=="C":
    count += 1
  ACindex[n+1] = count

for i in range(Q):
  l, r = map(int, sy[2+i].split())
  print(ACindex[r]-ACindex[l])
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [A[i] - (i+1) for i in range(N)]
B.sort()
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += B[i] - b
print(sum)

### FIXED CODE ###

import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [(A[i] - (i+1)) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))
import math
num=list(input().split())
A=int(num[0])
B=int(num[1])
print(A*B//math.gcd(A,B))

### FIXED CODE ###

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)
a, b input().split()
if a==b:
  print("=")
else:
  print("<" if a < b else ">")

### FIXED CODE ###

a, b = input().split()
if a==b:
  print("=")
else:
  print("<" if a < b else ">")
import math

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

lcm = int(c * d / math.gcd(c, d))

bb = int((b // c) + (b // d) - (b // lcm))

aa = int(((a-1) // c) + ((a-1) // d) - ((a-1) // lcm))

print(bb, aa)

print((b-a) - int(bb-aa) + 1)

### FIXED CODE ###

from fractions import gcd

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

lcm = int(c * d / gcd(c, d))

bb = int((b // c) + (b // d) - (b // lcm))

aa = int(((a-1) // c) + ((a-1) // d) - ((a-1) // lcm))

print((b-a) - int(bb-aa) + 1)
s = input()
Q = int(input())
for i in range(Q):
    tmp = list(input())
    if len(tmp)==1:
        s = s[::-1]
    else:
        f,c = tmp[2], tmp[4]
        if f=='1':
            s = '{}{}'.format(c,s)
        elif f=='2':
            s = '{}{}'.format(s,c)
        print(s)
print(s)

### FIXED CODE ###

from collections import deque
s = input()
Q = int(input())
s = deque([s])
rev = 1
for i in range(Q):
    tmp = list(input().split())
    if len(tmp)==1:
        rev *= -1
    else:
        f,c = tmp[1], tmp[2]
        if rev > 0:
            if f=='1':
                s.appendleft(c)
            else:
                s.append(c)
        else:
            if f=='1':
                s.append(c)
            else:
                s.appendleft(c)
s = ''.join(list(s))
print(s if rev > 0 else s[::-1])
from collections import Counter
n=int(input())
l=list(map(int,input().split()))
c=Counter(l)

edges=[]
for k,v in c.items():
    if v>=2:
        for i in range(v//2):
            edges.append(k)
edges.sort(reverse=True)
print(edges[0]*edges[1])


### FIXED CODE ###

from collections import Counter
n=int(input())
l=list(map(int,input().split()))
c=Counter(l)

edges=[]
for k,v in c.items():
    if v>=2:
        for i in range(v//2):
            edges.append(k)
if len(edges)>=2:
    edges.sort(reverse=True)
    print(edges[0]*edges[1])
else:
    print(0)
print(-input() + input() * 2)

### FIXED CODE ###

R, G = (int(input()) for i in range(2))
print(G * 2 - R)
N = int(input())
S = int(input())

def f(b, n):
    if n < b:
        return n
    else:
        return f(b, int(n/b)) + (n % b)

def solve(N, S):
    if N == S:
        return N+1
    else:
        for b in range(2, int(N**(1/2))+1):
            if f(b, N) == S:
                return b
        for p in range(1, int(N**(1/2))+1):
            b = int((N - S) / p + 1)
            if f(b, N) == S:
                return b
        return -1

print(solve(N, S))

### FIXED CODE ###

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

def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + (n % b)

def solve(N, S):
    if S > N:
        return -1
    elif N == S:
        return N+1
    else:
        for b in range(2, int(N**(1/2))+1):
            if f(b, N) == S:
                return b
        for p in range(int(N**(1/2)), 0, -1):
            if (N - S) % p == 0:
                b = (N - S) // p + 1
                if f(b, N) == S:
                    return b
        return -1

print(solve(N, S))
N = int(input())
h = list(map(int,input().split()))

cnt = 0
cnt_line = 0
for i in range(1, N):
    if h[i] < h[i - 1]:
        cnt += h[i - 1] - cnt_line
        cnt_line =h[i]
if h[-1] >= h[-2]:
    cnt += h[-1] - cnt_line
print(cnt)


### FIXED CODE ###

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


if len(h) == 1:
    print(h[0])
    exit()
    
cnt = 0
cnt_line = 0
v = h[0]
for i in range(1, N):
    if h[i] < v:
        cnt += v - cnt_line
        cnt_line = h[i]
    v = h[i]
if h[-1] >= h[-2]:
    cnt += h[-1] - cnt_line
print(cnt)
N,K=map(int,input().split())
A=list(map(int,input().split()))
kari=set()
hako=set()
count=0
cnt=0
zahyo=0
ans=0
kari.add(0)
if K<=10**6:
    for i in range(K):
        ans=A[ans]-1
    print(ans+1)
    exit()
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in kari:
        kari.add(zahyo)
        count+=1
    else:
        break
zahyo+=1
hako.add(zahyo)
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in hako:
        hako.add(zahyo)
        cnt+=1
    else:
        break
kaisu=K-count
if kaisu>N:
    kaisu=kaisu%cnt
for i in range(kaisu):
    zahyo=A[zahyo]-1
    #print(zahyo,kaisu,count,cnt)
print(zahyo+1)

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
kari=set()
hako=set()
count=1
cnt=1
zahyo=0
ans=0
kari.add(zahyo)
if K<=10**6:
    for i in range(K):
        ans=A[ans]-1
    print(ans+1)
    exit()
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in kari:
        kari.add(zahyo)
        count+=1
    else:
        break

hako.add(zahyo)
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in hako:
        hako.add(zahyo)
        cnt+=1
    else:
        break
count=len(kari)
cnt=len(hako)
kaisu=K-count
#print(zahyo)
if kaisu>N:
    kaisu=kaisu%cnt
for i in range(kaisu):
    zahyo=A[zahyo]-1
#print(zahyo,kaisu,count,cnt)
#print(kari,hako)
print(zahyo+1)
from math import log2
n,k = map(int,input().split())
l = []
cnt = 0
for i in range(1,n+1):
    if i < k:
        l.append(int(log2(k/i))+1)
    else:
        cnt += 1
maxi = max(l)
preans = cnt * 2**maxi
for i in l:
    preans += 2**(maxi-i)
ans = preans / (n*2**maxi)
print('{:.20f}'.format(ans))

### FIXED CODE ###

from math import log2,ceil
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    if i < k:
        ans += 1/2**(ceil(log2(k/i)))
    else:
        ans += 1
ans /= n
print('{:.15f}'.format(ans))
import math


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    mul = a[0]
    for i in range(1, n):
        mul = mul * a[i] // math.gcd(mul, a[i])
    if mul % 2 == 1:
        print(0)
        exit()
    ans = (m - mul / 2) // mul + 1
    print(int(ans))


if __name__ == '__main__':
    main()

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
 
def div_ceil(x, y): return (x + y - 1) // y
 
N, M = map(int, input().split())
*A, = map(int, input().split())
A = list(set([a // 2 for a in A]))
L = A[0]
for a in A[1:]:
    L *= a // gcd(L, a)
for a in A:
    if (L // a) % 2 == 0:
        ans = 0
        break
else:
    ans = div_ceil(M // L, 2)
print(ans)
import fractions
A,B = map(int,input.split())
ans = fractions.gcd(A, B)
print(ans)


### FIXED CODE ###

import fractions
A,B = map(int,input().split())
ans = A * B // fractions.gcd(A, B)
print(ans)
import math

a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) / math.gcd(x, y)

print(int(lcm(a, b)))

### FIXED CODE ###

import fractions

a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) / fractions.gcd(x, y)

print(int(lcm(a, b)))
S = input()
print(min((abs(765 - int(S[i:i+2])) for i in range(S-2))))


### FIXED CODE ###

S = input()
print(min((abs(753 - int(S[i:i+3])) for i in range(len(S)-2))))
# coding: utf-8

X = input(S)
q = X//100
mod = X%100

if q*5 > mod: print(1)
else: print(0)

### FIXED CODE ###

# coding: utf-8

X = int(input())
q = X//100
mod = X%100

if q*5 >= mod: print(1)
else: print(0)
N,blue,red = input().split()
count = 0
while(1):
  if N > 0:
    N -= blue
    count += 1
  if N > 0:
    N -= red
  else:
    break
print(blue*count + N)

### FIXED CODE ###

N,blue,red = map(int,input().split())
count = N // (blue + red)
amari = N % (blue + red)
if N%(blue+red) >= blue:
    print(blue*(count + 1))
else:
    print(blue * count + amari)
#!/usr/bin/env python3
#E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def comb(n, r):
    return fact[n]*pow(fact[n-r], mod-2, mod)*pow(fact[r], mod-2, mod) % mod
n = I()
ab = [LI() for _ in range(n)]
ans = pow(2, n, mod) - 1
fact = [1]*(n+1)
for i in range(1, n+1):
    fact[i] = i * fact[i-1]
    fact[i] %= mod
a_zero = 0
b_zero = 0
AB = []
lst = []
for a, b in ab:
    if a == 0 and b == 0:
        ans -= pow(2, n-1, mod)
        ans %= mod
        n -= 1
    elif a == 0:
        a_zero += 1
    elif b == 0:
        if a_zero:
            lst.append(b_zero)
        b_zero += 1
    else:
        AB.append([a, b])
x = [a / b for a, b in AB]
y = [- b / a for a, b in AB]
j = 0
if a_zero:
    while j + 1 < b_zero:
        ans -= comb(b_zero, j + 2) * pow(2, n - (b_zero - (j+2)) - (j+2), mod)
        ans %= mod
        j += 1

z = defaultdict(lambda : 0)
for i,j in enumerate(x):
    if z[j]:
        lst.append(z[j]+1)
    z[y[i]] += 1
for i in lst:
    j = 0
    while j + 1 < i:
        ans -= comb(i, j+2) * pow(2, n - (i-(j+2)) - (j+2), mod)
        ans %= mod
        j += 1
    n -= i
print(ans)




### FIXED CODE ###

#!/usr/bin/env python3
#E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def comb(n, r):
    return fact[n]*pow(fact[n-r], mod-2, mod)*pow(fact[r], mod-2, mod) % mod
n = I()
ab = [LI() for _ in range(n)]

fact = [1]*(n+1)
for i in range(1, n+1):
    fact[i] = i * fact[i-1]
    fact[i] %= mod

x = defaultdict(lambda : 0)
y = defaultdict(lambda : 0)
z = defaultdict(lambda : 0)
tmp = 0
for a, b in ab:
    if a == 0 and b == 0:
        tmp += 1
    elif a == 0:
        x[0] += 1
        z[0] = 1
    elif b == 0:
        y[0] += 1
        z[0] = 1
    else:
        if a * b > 0:
            g = math.gcd(a, b)
            a //= g
            b //= g
            x[(abs(a), abs(b))] += 1
            z[(abs(a), abs(b))] = 1
        else:
            g = math.gcd(a, b)
            a //= g
            b //= g
            y[(abs(b), abs(a))] += 1
            z[(abs(b), abs(a))] = 1

ans = 1
for i in z.keys():
    ans *= (2**x[i] + 2**y[i] - 1)
    ans %= mod
ans -= 1
ans += tmp
ans %= mod
print(ans)
n = int(input())
A = [map(int,input().split()) for _ in range(n)]
A.sort(key=lambda x: x[0])
most = A[0][0]
mos = A[0][1]
worst = A[-1][0]
wors = A[-1][1]
print((most-1)+(most-worst+1)+(wors+1))


### FIXED CODE ###

n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([a,b])
l.sort(reverse=True)

print(l[0][0]+l[0][1])
a,b,c=map(int,input().split())
if a+b+c >= 22:
   print("bust")
    else:
      print("win")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+c >= 22:
   print("bust")
else:
   print("win")
s = list(input())

prev = s[0]
count  = 0
for i in range(1, len(s)):
    print(s)
    if prev == s[i]:
        count += 1

        if prev == '0':
            s[i] = '1'
        else:
            s[i] = '0'

    prev = s[i]

print(count)

### FIXED CODE ###

s = list(input())

count1  = 0
count2 = 0

for i in range(len(s)):
    if i % 2 == 0 and s[i] == '1':
        count1 += 1
    elif i % 2 and s[i] == '0':
        count1 += 1

    if i % 2 == 0 and s[i] == '0':
        count2 += 1
    elif i % 2 and s[i] == '1':
        count2 += 1

print(min(count1, count2))
N,Q=map(int,input().split())
S=input()
count = [1 for i in range(0,N) if S[i:i+1] =='AC' else 0]
for i in range(0,Q):
  l,r=map(int,input().split())
  print(sum(count[l-1:r-1]))


### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
t=[0]*N
for i in range(0,N-1):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(0,Q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])
N = int(raw_input())                                                                                                                                                                p = [1]                                                                                                                                                                             for j in [6, 9]:                                                                                                                                                                      i = j                                                                                                                                                                               while i < N:
    p.append(i)
    i *= j
c = [N] * (N+1)
c[1] = 1
for i in range(1, N+1):
  for j in p:
    if i+j <= N:
      c[i+j] = min(c[i+j], c[i]+1)
print c[N]

### FIXED CODE ###

N = int(raw_input())
p = [1]
for j in [6, 9]:
  i = j
  while i <= N:
    p.append(i)
    i *= j
c = [N] * (N+1)
c[0] = 0
for i in range(0, N+1):
  for j in p:
    if i+j <= N:
      c[i+j] = min(c[i+j], c[i]+1)
print c[N]
A,B,K = map(int,input().split())
lists = list(range(A,B+1))
min_list = []
max_list = []
if K > len(lists):
        for m in range(len(lists)):
                print(lists[m])
else:
        for i in range(K):
                min_list.append(lists[i])
        for j in range(K,len(lists)):
                min_list.append(lists[j])
        for k in range(len(min_list)):
                print(min_list[k])

### FIXED CODE ###

A,B,K = map(int,input().split())
if abs(B-A) < K:
    for i in range(A,B+1):
        print(i)
    exit()
min_list = list(range(A,A+K))
max_list = list(range(B-K+1,B+1))
lists = list(set(min_list) | set(max_list))
lists.sort()
for i in range(len(lists)):
    print(lists[i])
n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
b=0
for i in range(n):
  b+=a[i]*(-1)**i
print(b)

### FIXED CODE ###

a=int(input())
b=int(input())
if a%500<=b:
  print("Yes")
else:
  print("No")
n = int(input())
line = map(int,input().split())
box = []
for i in line:
  for j in range(1,9):
    if i % 2**j != 0:
      box.append(j - 1)
answer = min(box)
print(answer)

### FIXED CODE ###

def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)
n= raw_input( "N : ")
x= raw_input( "X : ")
t= raw_input( "T : ")
N=int(n)
X=int(x)
T=int(t)
if(N % X == 0):
    print((N // X) * T)
else:
    print(((N // X) *T) + T)

### FIXED CODE ###

N,X,T = map(int, input().split())
if(N % X == 0):
    print((N // X) * T)
else:
    print(((N // X) *T) + T)
s=rr()
print('YNeos'[s[0]!=s[2]::2])

### FIXED CODE ###

s=input()
print('YNeos'[s[0]!=s[2]::2])
X,Y,A,B,C=map(int,input().split())
P=sorted(list(map(int,input().split())))
Q=sorted(list(map(int,input().split())))
R=sorted(list(map(int,input().split())))
S=sorted(P[A-X:]+Q[B-Y:])
i=0
while S[i]<R[-1-i]:
    if len(R)>i or len(S)>i:
        break
    i+=1
print(sum(S[i+1:])+R[-1-i:])

### FIXED CODE ###

X,Y,A,B,C=map(int,input().split())
P=sorted(list(map(int,input().split())))
Q=sorted(list(map(int,input().split())))
R=sorted(list(map(int,input().split())))
S=sorted(P[A-X:]+Q[B-Y:])
ans=sum(S)
for i in range(min(len(R),len(S))):
    if S[i]<R[-1-i]:
        S[i]=R[-1-i]
    else:
        break
print(sum(S))
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
A=[chr(97+int(i)) for i in range(n)]

Ans=["a"]
if n>=2:
  for _ in range(n-1):
    Ans2=[]
    for a in Ans:
      s=set()
      for aa in a:
        s.add(aa)
      ss=len(s)
      for i in range(ss+1):
        Ans2.append(a+A[i])
    Ans=Ans2
Ans.sort()
for ans in Ans:
  print(ans)

### FIXED CODE ###

import sys
input=lambda: sys.stdin.readline().rstrip()
A=input()
B=input()
C=input()

a,b,c=len(A),len(B),len(C)

def f(X,Y):
  XY=[True]*(10**4)
  x,y=len(X),len(Y)
  for i in range(5000-y+1,5000+x):
    ret=True
    if i<=5000:
      for j in range(min(x,y+i-5000)):
        if X[j]=="?" or Y[j-i+5000]=="?" or X[j]==Y[j-i+5000]:
          continue
        else:
          ret=False
    else:
      for j in range(min(y,x-i+5000)):
        if Y[j]=="?" or X[j+i-5000]=="?" or Y[j]==X[j+i-5000]:
          continue
        else:
          ret=False
    XY[i]=ret
  return XY
AB=f(A,B)
BC=f(B,C)
AC=f(A,C)
ans=a+b+c
for i in range(5000-b-c,5000+a+c):
  for j in range(5000-b-c,5000+a+b):
    if -4000<=j-i<=4000:
      if AB[i] and AC[j] and BC[j-i+5000]:
        l=min(5000,i,j)
        r=max(i+b,j+c,5000+a)
        ans=min(ans,r-l)
    else:
      if AB[i] and AC[j]:
        l=min(5000,i,j)
        r=max(i+b,j+c,5000+a)
        ans=min(ans,r-l)
print(ans)
x, y = map(int, input().split())

for a in range(0, x+1):
    b = x - a
    if a*2 + b*4 == y:
        ans = 'Yes'
        break

print(ans)


### FIXED CODE ###

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

for a in range(0, x+1):
    for b in range(0, x+1-a):
        if a + b == x:
            if a*2 + b*4 == y:
                print('Yes')
                exit()

print('No')
N,K,C=map(int,input().split())
S=input()

l=[]
la=[]
i=0
c=0
while True:
    if S[i]=="o":
        l.append(i)
        i+=C
        c+=1
    i+=1

if c>K:
    exit()

i=N-1
c=0

while True:
    if S[i]=="o":
        la.append(i)
        i-=C
        c+=1
    i-=1
    if c==K:
        break
    
for i in l:
    if i in la:
        print(i+1)

### FIXED CODE ###

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

l=[0]*N
la=[0]*N
i=0
c=0
while True:
    if S[i]=="o":
        l[i]=1
        i+=C
        c+=1
    i+=1
    if i>=N:
        break

if c>K:
    exit()

i=N-1
c=0

while True:
    if S[i]=="o":
        la[i]=1
        i-=C
        c+=1
    i-=1
    if c==K:
        break
    
for i in range(N):
    if l[i]==1 and la[i]==1:
        print(i+1)
s = input()
print(len([i for i in s i == '1']))

### FIXED CODE ###

s = input()
print(len([i for i in s if i == '1']))