Harryxun/stf_run huggingface dataset:
from collections import deque
import copy
def solve(maze, start, end):
  memo = []
  q = deque()
  q.append([start,[]])
  ans = 0
  while q:
    cur, path = q.popleft()
    if cur == end:
      ans = path
      break
    elif cur in memo:
      continue
    else:
      memo.append(cur)
      for y, x in zip((0,0,1,-1),(1,-1,0,0)):
        if maze[cur[0]+y][cur[1]+x] == ".":
          q.append([[cur[0]+y,cur[1]+x],copy.deepcopy(path)+[cur]])
  return ans


H, W = map(int, input().split())
Maze = [["#"]*(W+2)]+[["#"]+list(input())+["#"] for _ in range(H)] + [["#"]*(W+2)]
Ans = 0
for sy in range(1, H+1):
  for sx in range(1, W+1):
    if Maze[sy][sx] == "#":
      continue
    memo = [[False]*(W+2) for _ in range(H+2)]
    for ey in range(H+1, sy,-1):
      for ex in range(1, W+1):
        if Maze[ey][ex] == "#" or memo[ey][ex]:
          continue
        P = solve(Maze, [sy, sx], [ey,ex])
        Ans = max(Ans, len(P))
        for p in P:
          memo[p[0]][p[1]] = True
print(Ans)

### FIXED CODE ###

alphabet = list("abcdefghijklmnopqrstuvwxyz")
s = input()
print(alphabet[alphabet.index(s)+1])
import math
def lcm(a,b):
    return (a * b) // math.gcd(a, b)

A,B,C,D=map(int,input().split())
E=lcm(C,D)

num_C=B//C-(A-1)//C
num_D=B//D-(A-1)//D
num_CD=B//E-(A-1)//E

ans=(B-A+1)-(num_C+num_D-num_CD)
print(ans)

### FIXED CODE ###

from fractions import gcd
def lcm(a,b):
    return (a * b) // gcd(a, b)

A,B,C,D=map(int,input().split())

E=lcm(C,D)

num_C=B//C-(A-1)//C
num_D=B//D-(A-1)//D
num_CD=B//E-(A-1)//E

ans=(B-A+1)-(num_C+num_D-num_CD)
print(ans)
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time,os
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

# In[]:
debug = os.getcwd()[0] == "C"
debug

# In[]:
if DEBUG:
    K,X = 2,900
else:
    K,X = inpl()

# In[]:
if K*500 >= X:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

K,X = inpl()
if K*500 >= X:
    print("Yes")
else:
    print("No")
a,b = (int(i) for i in input().split())
     
     
if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

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

if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")
print("Yay!" if int(input())<9 and int(input())<9 else ":(")

### FIXED CODE ###

a,b = map(int, input().split())
print("Yay!" if a<9 and b<9 else ":(" )
N = int(input())
a = input().split()
num=[]
numabs=[]
tex=[]
count=0
for i in range(N):
	num.append(int(a[i]))
	numabs.append(abs(num[i]))
	if num[i] < 0 :
		count +=1
	elif num[i] == 0:
		count2 +=1
if count%2 ==0 or count2 > 0:
	res = sum(num)
else:
	res =sum(num)-2*min(numabs)
print(res)
             

### FIXED CODE ###

N = int(input())
a = input().split()
num=[]
numabs=[]
tex=[]
count=0
count2=0
for i in range(N):
	num.append(int(a[i]))
	numabs.append(abs(num[i]))
	if num[i] < 0 :
		count +=1
	elif num[i] == 0:
		count2 +=1
if count%2 ==0 or count2 > 0:
	res = sum(numabs)
else:
	res =sum(numabs)-2*min(numabs)
print(res)
ab, bc = map(int, input().split())
print(ab*bc/2)

### FIXED CODE ###

ab, bc, ca = map(int, input().split())
print(int(ab*bc/2))
a = int(input())
b = int(input())
print(a * b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2:
	print("NO")
else:
	print("YES")

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if n==1:
	print("YES")
elif (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2:
	print("NO")
else:
	print("YES")
k = int(input())
l = [2, 7, 17, 37, 47, 67, 97, 107, 127, 137, 157, 167, 197, 227, 257, 277, 307, 317, 337, 347, 367, 397, 457, 467, 487, 547, 557, 577, 587, 607, 617, 647, 677, 727, 757, 787, 797, 827, 857, 877, 887, 907, 937, 947, 967, 977, 997]
print(" ".join(map(str,l[0:k])))

### FIXED CODE ###

a ,b = map(int, input().split())
if b < a:
    ans = a-1
else:
    ans = a
print(ans)
sa=list(input())
sb=list(input())
sc=list(input())
cnt=sa[0]
sa.remove(sa[0])
while len(sa)!=0 or len(sb)!=0 or len(sc)!=0:
    #print(sa,sb,sc)
    if cnt=='a':
        cnt=sa[0]
        sa.remove(sa[0])
    elif cnt=='b':
        cnt=sb[0]
        sb.remove(sb[0])
    elif cnt=='c':
        cnt=sc[0]
        sc.remove(sc[0])
    if len(sa)==0 and cnt=='a':
        print("A")
        break
    elif len(sb)==0 and cnt=='b':
        print("B")
        break
    elif len(sc)==0 and cnt=='c':
        print("C")
        break


### FIXED CODE ###

sa=list(input())
sb=list(input())
sc=list(input())
cnt=sa[0]
sa.remove(sa[0])
while len(sa)!=0 or len(sb)!=0 or len(sc)!=0:
    #print(sa,sb,sc)
    if cnt=='a':
        if sa!=[]:
            cnt=sa[0]
            sa.remove(sa[0])
    elif cnt=='b':
        if sb!=[]:
            cnt=sb[0]
            sb.remove(sb[0])
    elif cnt=='c':
        if sc!=[]:
            cnt=sc[0]
            sc.remove(sc[0])
    if len(sa)==0 and cnt=='a':
        print("A")
        break
    elif len(sb)==0 and cnt=='b':
        print("B")
        break
    elif len(sc)==0 and cnt=='c':
        print("C")
        break
from itertools import*
(n,),a,b=eval('eval(input().replace(" ",",")),'*3)
i=list(permutations(range(1,n+1))).index
print(abs(i(a)-i(b)))

### FIXED CODE ###

from itertools import*;(n,),a,b=eval('tuple(map(int,input().split())),'*3);i=list(permutations(range(1,n+1))).index;print(abs(i(a)-i(b)))
N = int(input())

list = list(range(1, N))

print(sum(list))


### FIXED CODE ###

N = int(input())

print(N*(N-1)//2)
s = int(input())

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")

### FIXED CODE ###

s = input()

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")
import math 

all_list = []

for i in range(5):
  a = int(input())

  all_list.append(a)
  
last_list = [x % 10 for x in all_list if x % 10 > 0]
last_list2 = [x for x in all_list if x % 10 > 0]
last_x = last_list2[last_list.index(min(last_list))]

all_list.remove(last_x)

sum_list = [math.ceil(x / 10) * 10 for x in all_list]

m = sum(sum_list) + last_x
print(m)

### FIXED CODE ###

import math 

all_list = []

for i in range(5):
  a = int(input())

  all_list.append(a)
  
last_list = [x % 10 for x in all_list if x % 10 > 0]
last_list2 = [x for x in all_list if x % 10 > 0]

if len(last_list) > 0:
  last_x = last_list2[last_list.index(min(last_list))]
  all_list.remove(last_x)
else:
  last_x = 0

sum_list = [math.ceil(x / 10) * 10 for x in all_list]

m = sum(sum_list) + last_x
print(m)
import numpy as np
from collections import deque

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())

ch-=1
cw-=1
dh-=1
dw-=1

S=[]
for _ in range(h):
  s=input()
  sl=[]
  for i in range(w):
    sl.append(s[i])
  S.append(sl)

def isable(X):
  xh,xw=X[0],X[1]
  if 0<=xh<=h-1 and 0<=xw<=w-1 and S[xh][xw]=='.':
    return True
  else:
    return False

def stepA(X):
  xh,xw=X[0],X[1]
  A=[]
  for p,q in [(-1,0),(0,1),(1,0),(0,-1)]:
    if isable([xh+p,xw+q]):
      A.append([xh+p,xw+q])
  return A
    
def stepB(X):
  xh,xw=X[0],X[1]
  B=[]
  for i in range(-2,3):
    for j in range(-2,3):
      if i==0 and j==0:
        continue
      if isable([xh+i,xw+j]):
        B.append([xh+i,xw+j])
  return B

Q=deque()
Q.appendleft((ch,cw))
cost=[[float('inf') for i in range(w)] for j in range(h)]
cost[ch][cw]=0

while Q:
  ph,pw=Q.popleft()
  for v in stepA([ph,pw]):
    ah,aw=v[0],v[1]
    if isable([ah,aw]):
      if cost[ah][aw]>cost[ph][pw]:
        cost[ah][aw]=cost[ph][pw]
        Q.appendleft([ah,aw])
  for bh,bw in stepB([ph,pw]):
    if isable([bh,bw]):
      if cost[bh][bw]>cost[ph][pw]+1:
        cost[bh][bw]=cost[ph][pw]+1
        Q.append([bh,bw])

if cost[dh][dw]==float('inf'):
  print(-1)
else:
  print(cost[dh][dw])

### FIXED CODE ###

from collections import deque

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())

ch-=1
cw-=1
dh-=1
dw-=1

S=[]
for _ in range(h):
  s=input()
  sl=[]
  for i in range(w):
    sl.append(s[i])
  S.append(sl)

def isable(X):
  xh,xw=X[0],X[1]
  if 0<=xh<=h-1 and 0<=xw<=w-1 and S[xh][xw]=='.':
    return True
  else:
    return False

def stepA(X):
  xh,xw=X[0],X[1]
  A=[]
  for p,q in [(-1,0),(0,1),(1,0),(0,-1)]:
    if isable([xh+p,xw+q]):
      A.append([xh+p,xw+q])
  return A
    
def stepB(X):
  xh,xw=X[0],X[1]
  B=[]
  for i in range(-2,3):
    for j in range(-2,3):
      if i==0 and j==0:
        continue
      if isable([xh+i,xw+j]):
        B.append([xh+i,xw+j])
  return B

Q=deque()
Q.appendleft((ch,cw))
cost=[[float('inf') for i in range(w)] for j in range(h)]
cost[ch][cw]=0

while Q:
  ph,pw=Q.popleft()
  for v in stepA([ph,pw]):
    ah,aw=v[0],v[1]
    if isable([ah,aw]):
      if cost[ah][aw]>cost[ph][pw]:
        cost[ah][aw]=cost[ph][pw]
        Q.appendleft([ah,aw])
  for bh,bw in stepB([ph,pw]):
    if isable([bh,bw]):
      if cost[bh][bw]>cost[ph][pw]+1:
        cost[bh][bw]=cost[ph][pw]+1
        Q.append([bh,bw])

if cost[dh][dw]==float('inf'):
  print(-1)
else:
  print(cost[dh][dw])
W, H, x, y = [int(i) for i in input).split()]
ans1 = W * H / 2
ans2 = 1 if x*2==W or y*2==H else 0
print(str(ans1) + " " + str(ans2))

### FIXED CODE ###

W, H, x, y = [int(i) for i in input().split()]
ans1 = W * H / 2
ans2 = 1 if (x*2==W and y*2==H) else 0
print(str(ans1) + " " + str(ans2))
n = int(input())
a = input().split()

money = 1000
stock = 0
pivot = []
flag = 0

for i in range(n):
    pivot.append(int(a[i+1]) - int(a[i]))

pivot.append(-1)
pivot.append(-1)

i=0

for j in range(n):
    if(pivot[j]>0):
        i = j
        break
    else:
        flag = -1

if(flag != -1):
    stock = int(money//int(a[i]))
    money = int(money%int(a[i]))

i+=1
if(flag != -1):
    while(i<n):
        if(i==n-1):
            if(pivot[i]>0):
                money = money + stock*int(a[i+1])
                stock = 0
            break

        elif(pivot[i]<0):
            while(pivot[i+1]<=0 and flag != -1):
                if(i==n-2):
                    flag = -1
                i+=1
            if(flag != -1):
                stock = int(money//int(a[i+1]))
                money = int(money%int(a[i+1]))
                i+=1
        else:
            while(pivot[i+1]>=0 and flag != -1):
                if(i==n-2):
                    flag = -1
                i+=1
            money = money + stock*int(a[i+1])
            stock = 0
            i+=1

print(money)




### FIXED CODE ###

n = int(input())
a = input().split()

money = 1000
stock = 0
pivot = []
upflag = 0
dnflag = 1

if(int(a[1]) - int(a[0]) > 0): # initial
    stock = int(money // (int(a[0])))
    money = int(money % (int(a[0])))
    upflag = 1
    dnflag = 0

for i in range(n-2): # i=0,1,,,,n-3 (for n=7, n-3=4)
    if(int(a[i+1]) == int(a[i])):
        if((int(a[i+2]) - int(a[i+1]) < 0) and upflag == 1): # i+1 is local max so that to sell stock
            money = money + stock * (int(a[i+1]))
            stock = 0
            upflag = 1
            dnflag = 0
        elif((int(a[i+2]) - int(a[i+1]) > 0) and dnflag == 1): # i+1 is local min so that to sell stock
            stock = int(money // (int(a[i+1])))
            money = int(money % (int(a[i+1])))
            upflag = 0
            dnflag = 1

    elif(int(a[i+1]) - int(a[i]) > 0):
        upflag = 1
        if(int(a[i+2]) - int(a[i+1]) < 0): # i+1 is local max so that to sell stock
            money = money + stock * (int(a[i+1]))
            stock = 0
            upflag = 0

    elif(int(a[i+1]) - int(a[i]) < 0):
        dnflag = 1
        if(int(a[i+2]) - int(a[i+1]) > 0): # i+1 is local min so that to buy stock
            stock = int(money // (int(a[i+1])))
            money = int(money % (int(a[i+1])))
            dnflag = 0

if(int(a[n-1]) - int(a[n-2]) > 0): # sell @ final
    money = money + stock * (int(a[n-1]))
elif(int(a[n-1]) - int(a[n-2]) == 0):
    if(upflag == 1):
        money = money + stock * (int(a[n-1]))

print(money)
x=list(map(int,input().split))
x.sort()
print(x[-1]*10+x[-2]+x[-3])

### FIXED CODE ###

x=list(map(int,input().split()))
x.sort()
print(x[-1]*10+x[-2]+x[-3])
import sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  print(mA,mB,i)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")

### FIXED CODE ###

s = input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")
a = list(map(int,input().split()))
if a[0]*a[1]<=a[2]:
  prnit(a[0]*a[1])
else:
  print(a[2])


### FIXED CODE ###

a = list(map(int,input().split()))
if a[0]*a[1]<=a[2]:
  print(a[0]*a[1])
else:
  print(a[2])
n=int(input())
h=list(map(int,input().spliy()))
ans=0
while sum(h)>0:
  for i in range(n):
    if i<n-1 and h[i]>0 and h[i+1]==0:
      ans+=1
    else:
      if i==N-1 and h[i]>0:
        ans+=1
    if h[i]>0:
      h[i]-=1
print(ans)      

### FIXED CODE ###

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

ans=0
while sum(h)>0:
  for i in range(N):
    if i<N-1 and h[i]>0 and h[i+1]==0:
      ans+=1
    else:
      if i==N-1 and h[i]>0:
        ans+=1
    if h[i]>0:
      h[i]-=1
  #print(h)
print(ans)
N, K = map(int, input().split())
D = list(map(int, input().split()))
S = ""
ND = []
for i in range(10):
  if i not in D:
    ND.append(i)

if K == 9:
  while int(S) < N:
    S = str(ND[0]) + S[:]
  print(int(S))
else:
  l = 0
  F = ND[0]
  while F < N:
    l += 1
    s = l
    F = 0
    ju = 1
    while s != 0:
      F += ND[s%(10-K)] * ju
      s //= 10 - K
      ju *= 10
  print(F)

### FIXED CODE ###

N, K = map(int, input().split())
D = list(map(int, input().split()))
S = ""
ND = []
for i in range(10):
  if i not in D:
    ND.append(i)

if K == 9:
  S = str(ND[0])
  while int(S) < N:
    S = str(ND[0]) + S[:]
  print(int(S))
else:
  l = 0
  F = ND[0]
  j = 10 - K
  cnt = 0
  while F < N:
    l += 1
    s = l
    F = 0
    ju = 1
    if l == j:
      l, s = 0, 0
      j *= 10 - K
      cnt += 1
    for x in range(cnt+1):
      F += ND[s%(10 - K)] * ju
      ju *= 10
      s //= 10 - K
  print(F)
n = int(input())
t, a = map(int, input().split())
array = list(map(int, input().split()))

sa = 60
for i in range(n):
    if sa > a - (t - array[i] * 0.006):
        sa = a - (t - array[i] * 0.006)
        ans = i + 1

print(ans)

### FIXED CODE ###

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

sa = 10000
for i in range(n):
    if sa > abs(a - (t - array[i] * 0.006)):
        sa = abs((a - (t - array[i] * 0.006)))
        ans = i + 1

print(ans)
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

n = I()
a = LI()

a.sort()
f = [False]*n

if(a[0] == a[1]):
    f[0] = True
for i in range(1,n):
    for j in range(0,i):
        if(a[i] % a[j] == 0):
            f[i] = True
            break

count = 0
for i in range(n):
    if(not f[i]):
        count += 1

print(count)

### FIXED CODE ###

import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

n = I()
a = LI()

a.sort()
m = a[n-1]
flg = [False]*(m+1)

count = 0
for x in range(n):
    v = a[x]
    if(not flg[v]):
        i = v
        while(i <= m):
            flg[i] = True
            i += v
        if(x == n-1 or v != a[x+1]):
            count += 1

print(count)
N,W,H=[int(i) for i in input.split()]

ans=0

for i in range(N):
  h,w=[int(x) for x in input.split()]
  if h<=H and w<= W:
    ans+=1

print(ans)

### FIXED CODE ###

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

ans=0

for i in range(N):
  w,h=[int(x) for x in input().split()]
  if h>=H and w>= W:
    ans+=1

print(ans)
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7)

### FIXED CODE ###

N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))
import math
total = 0
A = int(input())
listB = list(map(int,input().split()))
if 1 < A:
    B = listB[0] * listB[1] // math.gcd(listB[0],listB[1])
    for i in range(A-2):
        B = listB[i+2] * B // math.gcd(B,listB[i+2])
else:
    B = listB[0]
for i in listB:
    total += B // i
print(B / total)

### FIXED CODE ###

import fractions
total = 0
A = int(input())
listB = list(map(int,input().split()))
if 1 < A:
    B = listB[0] * listB[1] // fractions.gcd(listB[0],listB[1])
    for i in range(A-2):
        B = listB[i+2] * B // fractions.gcd(B,listB[i+2])
else:
    B = listB[0]
for i in listB:
    total += B // i
print(B / total)
S = input()
K = int(input())

# S = "9999"
# K = 1

ans = 1

for i in range(len(S)):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        ones = i
        break

if not ones:
    ans = 1
elif K <= ones:
    ans = 1

print(ans)


### FIXED CODE ###

S = input()
K = int(input())

# S = "111111111"
# K = 6565

ans = 1
ones = -1

for i in range(len(S)):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        ones = i
        break

if ones == -1:
    ones = len(S) + 1

if K <= ones:
    ans = 1

print(ans)
#encoding utf-8

n = int(input())
data = []
for i in range(n):
    x,y,h=map(int,input().split())
    data.append([x,y,h])

def calH(cx,cy,data):
    return data[2]+abs(data[0]-cx)+abs(data[1]-cy)

def conh(temH,cx,cy,data):
    return temH-abs(data[0]-cx)-abs(data[1]-cy)


for i in range(101):
    for j in range(101):
        temH = calH(i,j,data[0])
        count = 0
        for k in range(n):
            ignore_flag = 0
            if data[k][2] == 0:
                if conh(temH,i,j,data[k]) < 0:
                    ignore_flag = 1
                    count += 1

            if ignore_flag == 0:
                if calH(i,j,data[k]) != temH:
                    break
                else:
                    count += 1
            if count == n:
                answer=[i,j,calH(i,j,data[0])]

print(answer[0],answer[1],answer[2])

### FIXED CODE ###

#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
xyh = []
for i in range(N):
    x, y, h = LI()
    xyh.append([x, y, h])


"""

C_x C_y H

XYの高度はmax(H - abs(X - C_x) - abs(Y - C_y), 0)
"""
xyh = sorted(xyh, key=lambda xyh: xyh[2], reverse=True)

# print(xyh)
ans = (0,0,0)
for c_x in range(101):
    for c_y in range(101):
        H = 0
        flag = True
        for i, (x, y, h) in enumerate(xyh):
            if i == 0:
                H = h + abs(x - c_x) + abs(y - c_y)
            if h != max(H - abs(x - c_x) - abs(y - c_y), 0):
            # if H != max(h + abs(x - c_x) + abs(y - c_y), 0):
                flag = False
        if flag:
            ans = (c_x, c_y, H)
    
X, Y, H = ans
print(X, Y, H)
x = input().split(" ")
a = int(x[0])
b = int(x[1])


if (a>b):
    print("GREATER")
elif(a==b):
    print("EQUAL")
else:
    print("LESS")


### FIXED CODE ###

a = int(input())
b = int(input())


if (a>b):
    print("GREATER")
elif(a==b):
    print("EQUAL")
else:
    print("LESS")
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
if k > 0:
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

### FIXED CODE ###

import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10
 
aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
if k > 0:
  l = r[r != 0].min()
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)
from fractions import gcd

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

N, M = map(int, input().split())
A = list(set(map(int, input().split())))
cur_lcm = lcm(A[0], A[1])

for a in A[1:]:
    cur_lcm = lcm(cur_lcm, a)

if M < cur_lcm / 2:
    print(0)
else:
    print(M // cur_lcm + 1)

### FIXED CODE ###

from fractions import gcd

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

def solve(N, M, A):
    while A[0] % 2 == 0:
        for idx, a in enumerate(A):
            if a % 2 != 0:
                return 0
            A[idx] //= 2
        M //= 2

    for a in A:
        if a % 2 == 0:
            return 0

    cur_lcm = 1
    for a in A:
        cur_lcm = lcm(cur_lcm, a)
        if M < cur_lcm:
            return 0
    return (M // cur_lcm + 1) // 2

if __name__ == '__main__':
    N, M = map(int, input().split())
    A = list((map(int, input().split())))
    A = [a // 2 for a in A]
    print(solve(N, M, A))
n,r = map(int, input.split())
 
if n >= 10:
  print(r)
else:
  print(r + 100 * (10-n)) 

### FIXED CODE ###

n,r = map(int, input().split())
 
if n >= 10:
  print(r)
else:
  print(r + 100 * (10-n))
N = int(input())
A = sorted(list(map(int,input().split())))
if N % 2 == 0:
    for i in range(1, N//2+1):
        if A[(i-1)*2] == A[1+(i-1)*2] == 2*i-1:
            continue
        else:
            print(0)
            exit()
    print(2**(N//2))
else:
    if A[0] == 0 and A[1] != 0:
        for i in range(1, N//2+1):
            if A[2*i-1] == A[2*i] == 2*i:
                continue
            else:
                print(0)
                exit()
        print(2**(N//2))
    else:
        print(0)
        exit()


### FIXED CODE ###

N = int(input())
A = sorted(list(map(int,input().split())))
MOD = 10**9+7
if N == 1:
    print(1)
    exit()
if N % 2 == 0:
    for i in range(1, N//2+1):
        if A[(i-1)*2] == A[1+(i-1)*2] == 2*i-1:
            pass
        else:
            print(0)
            exit()
    print(2**(N//2)%MOD)
else:
    if A[0] == 0 and A[1] != 0:
        for i in range(1, N//2+1):
            if A[2*i-1] == A[2*i] == 2*i:
                pass
            else:
                print(0)
                exit()
        print(2**(N//2)%MOD)
    else:
        print(0)
        exit()
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    ans = ans + 1
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"

print(ans)


### FIXED CODE ###

a = str(input())
ans = 0
if a[0] == "1":
    ans = ans + 1

if a[1] == "1":
    ans = ans + 1

if a[2] == "1":
    ans = ans + 1

print(ans)