Harryxun/stf_run huggingface dataset:
import sys
def MI(): return map(int, sys.stdin.readline().split())

H,W = MI()
s = [list(input()) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]

if s[0][0]=='#':
	dp[0][0] = 1

for i in range(W-1):
	if s[0][i+1]=='#' and s[0][i]=='.':
		dp[0][i+1] = dp[0][i] + 1
	else:
		dp[0][i+1] = dp[0][i]

for i in range(H-1):
	if s[i+1][0]=='#' and s[i][0]=='.':
		dp[i+1][0] = dp[i][0] + 1
	else:
		dp[i+1][0] = dp[i][0]

if H==1 or W==1:
	print(dp[W-1][H-1])
	sys.exit()
# print(dp)

def next(start, goal, start_value):
	if start=='.' and goal=='#':
		start_value += 1
	return start_value

for i in range(1,W):
	for j in range(1,W):
		# print(next(s[i][j-1],s[i][j],dp[i][j-1]),next(s[i-1][j],s[i][j],dp[i-1][j]))
		dp[i][j] = min(next(s[i][j-1],s[i][j],dp[i][j-1]),next(s[i-1][j],s[i][j],dp[i-1][j]))
print(dp[W-1][H-1])

### FIXED CODE ###

import sys
def MI(): return map(int, sys.stdin.readline().split())

H,W = MI()
s = [list(input()) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]

if s[0][0]=='#':
	dp[0][0] = 1

for i in range(W-1):
	if s[0][i+1]=='#' and s[0][i]=='.':
		dp[0][i+1] = dp[0][i] + 1
	else:
		dp[0][i+1] = dp[0][i]

for i in range(H-1):
	if s[i+1][0]=='#' and s[i][0]=='.':
		dp[i+1][0] = dp[i][0] + 1
	else:
		dp[i+1][0] = dp[i][0]

def next(start, goal, start_value):
	if start=='.' and goal=='#':
		start_value += 1
	return start_value

for i in range(1,H):
	for j in range(1,W):
		# print(next(s[i][j-1],s[i][j],dp[i][j-1]),next(s[i-1][j],s[i][j],dp[i-1][j]))
		dp[i][j] = min(next(s[i][j-1],s[i][j],dp[i][j-1]), next(s[i-1][j],s[i][j],dp[i-1][j]))

print(dp[H-1][W-1])
import fractions

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

print(a * b / fracions.gcd(a * b))


### FIXED CODE ###

import fractions

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

print(a * b // fractions.gcd(a, b))
import itertools
import math

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

count_M = 0
count_A = 0
count_R = 0
count_C = 0
count_H = 0

for l in S_list:
    if l.startswith('M'):
        count_M += 1
    elif l.startswith('A'):
        count_A += 1
    elif l.startswith('R'):
        count_R += 1
    elif l.startswith('C'):
        count_C += 1
    elif l.startswith('H'):
        count_H += 1

count = [count_M,count_A,count_R,count_C,count_H]
a = sum(count)

x = a*(a-1)*(a-2)/math.factorial(3)

for c in count:
    if c > 2:
        x -= c*(c-1)*(c-2)/math.factorial(3)
    elif c == 2:
        x -= (a-2)

print(int(x))


### FIXED CODE ###

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

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2))
else:
    print(0)

### FIXED CODE ###

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

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if 2 * i not in counts or counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if 2 * i - 1 not in counts or counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2) % 1000000007)
else:
    print(0)
S = input()

if S == 'A':
    print('T')
elif S == 'C':
    print('G')
elif S == 'G':
    print('C')
elif S == 'T'::
    print('A')


### FIXED CODE ###

S = input()

if S == 'A':
    print('T')
elif S == 'C':
    print('G')
elif S == 'G':
    print('C')
elif S == 'T':
    print('A')
import sys
sys.setrecursionlimit(10**9)
l = []
def calc3(s, N):
    if len(s) == N:
        l.append(s)
        return
    if len(s) > 0:
        c = s[-1]
        s2 = s[:]
        z = ord(c) - ord('a') + 2
        for i in range(z):
            st = s[:]
            st += chr(ord('a')+i)
            calc3(st[:], N)
    else:
        c = 'a'
        s += chr(ord(c))
        calc3(s[:], N)
def main():
    N = int(input())
    s = ''
    calc3(s[:], N)
    l = sorted(set(l))
    for i in l:
        print(i)
main()



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
def main():
    N = int(input())
    s = ''
    l = []
    def calc3(s, N, i):
        if len(s) == N:
            l.append(s)
            return
        if len(s) > 0:
            s2 = s[:]
            z = i + 2
            for j in range(z):
                st = s[:]
                st += chr(ord('a')+j)
                if j == i + 1:
                    calc3(st[:], N, i+1)
                else:
                    calc3(st[:], N, i)
        else:
            s += 'a'
            calc3(s[:], N, i)
    calc3(s[:], N, 0)
    l = sorted(set(l))
    for i in l:
        print(i)
main()
N=int(input())
A=list(map(int, input().split()))
A.sort()
B=[1]*(10**6+1)
counter=0
for i in range(N):
  if 0<i<N-1 and (A[i]==A[i-1] or A[i]==A[i+1]):
    continue
  elif i==0 and A[i]==A[i+1]:
    continue
  elif i==N-1 and A[i-1]==A[i]:
    continue
  
  if B[A[i]]==1:
    counter+=1
    j=2
    while A[i]*j<=10**6:
      B[A[i]*j]=0
      j+=1
print(counter)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
A.sort()
B=[1]*(10**6+1)
counter=0

if N==1:
  print(1)
  exit()
  
if N==2:
  if A[0]==A[1]:
    print(0)
  elif A[1]%A[0]==0:
    print(1)
  else:
    print(2)
  exit()
  
for i in range(N):
  if 0<i<N-1 and (A[i]==A[i-1] or A[i]==A[i+1]):
    if B[A[i]]!=0:
      B[A[i]]=0
      j=2
      while A[i]*j<=10**6:
        B[A[i]*j]=0
        j+=1
    continue
  elif i==0 and A[i]==A[i+1]:
    if B[A[i]]!=0:
      B[A[i]]=0
      j=2
      while A[i]*j<=10**6:
        B[A[i]*j]=0
        j+=1
    continue
  elif i==N-1 and A[i-1]==A[i]:
    if B[A[i]]!=0:
      B[A[i]]=0
      j=2
      while A[i]*j<=10**6:
        B[A[i]*j]=0
        j+=1
    continue
  
  if B[A[i]]==1:
    counter+=1
    j=2
    while A[i]*j<=10**6:
      B[A[i]*j]=0
      j+=1
print(counter)
import numpy as np

s = input()

dp = np.zeros(shape=(len(s), 13), dtype=int)

# 初期値
digit = s[0]
ii = len(s) - 1
if digit == '?':
    for j in range(10):
        num = j * (10**ii)
        amari = num % 13
        dp[0][amari] += 1
else:
    num = int(digit) * (10**ii)
    amari = num % 13
    dp[0][amari] += 1

for i in range(1, len(s)):
    ii = len(s) - 1 - i
    digit = s[i]
    if digit == '?':
        for j in range(10):
            num = j * (10**ii)
            amari = num % 13
            for k in range(13):
                dp[i][k] += dp[i-1][k-amari]
                dp[i][k] = dp[i][k] % (10**9+7)
    else:
        num = int(digit) * (10**ii)
        amari = num % 13
        for k in range(13):
            dp[i][k] += dp[i-1][k-amari]
            dp[i][k] = dp[i][k] % (10**9+7)

print(dp[len(s)-1][5] % (10**9+7))

### FIXED CODE ###

s = input()
s = s[::-1]
n = len(s)
mod = 10**9 + 7

dp = [[0 for j in range(13)] for i in range(n)]
if s[0] == '?':
    for i in range(10):
        dp[0][i] = 1
else:
    num = int(s[0])
    dp[0][num] = 1

mul = 1
for i in range(1, n):
    mul = (mul*10) % 13
    if s[i] == '?':
        for m in range(10):
            num = (m * mul) % 13
            for j in range(13):
                dp[i][(j+num)%13] = (dp[i][(j+num)%13] + dp[i-1][j]) % mod
    else:
        num = (int(s[i]) * mul) % 13
        for j in range(13):
            dp[i][(j+num)%13] = (dp[i][(j+num)%13] + dp[i-1][j]) % mod

print(dp[n-1][5])
n = int(input().strip())
a = [int(x) for x in input().strip().split()]
flg = [-1 for i in range(n)]
b = []
l = [[] for i in range(n)]
for i in range(n - 1):
  b.append([int(x) - 1 for x in input().strip().split()])
for x in b:
  l[x[0]].append(x[1])
  l[x[1]].append(x[0])
 
while True:
  minimum = a[0]
  idx = []
  for i, x in enumerate(a):
    if flg[i] != -1 or x > minimum:
      continue
    if x < minimum:
      minimum = x
      idx =[i]
    else:
      idx.append(i)
  while True:
    w = []
    for i in idx:
      flg[i] = 0
      for x in l[i]:
        if flg[x] == -1 and a[x] != a[i]:
          flg[x] = 1
          w.append(x)
    idx = []
    for i in w:
      for x in l[i]:
        if flg[x] == -1:
          flg[x] = 0
          for y in l[x]:
            if flg[y] == -1 and a[x] > a[y]:
              flg[x] = -1
              break
          if flg[x] == 0:
            idx.append(x)
    if len(idx) == 0:
      break
  if -1 not in flg:
    break

sep = ''
s = ''
for i, x in enumerate(flg):
  if x == 1:
    s += sep + str(i + 1)
    sep = ' '

print(s)


### FIXED CODE ###

input()
i = [int(x) % 2 for x in input().strip().split()]
if sum(i) % 2 == 0:
  print('YES')
else:
  print('NO')
a = int(input)
n = a + a*a + a*a*a
print(n)

### FIXED CODE ###

a = int(input())
n = a + a*a + a*a*a
print(n)
def DFS(num):
    global ans,color
    color[num]="black"
    if "white" not in color:
        ans +=1
    for i in M[num]:
        DFS(i)
    color[num]="white"


n,m=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(m)]

M=[[] for _ in range(n)]
color=["white" for _ in range(n)]
for a,b in AB:
    M[a-1].append(b-1)
    M[b-1].append(a-1)

ans=0
DFS(0)
print(ans)

### FIXED CODE ###

from itertools import permutations
n,m=map(int,input().split())

M=[[] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    M[a-1].append(b-1)
    M[b-1].append(a-1)

ans=0
for A in permutations(range(n),n):
    if A[0]==0:
        for i in range(n):
            if i==n-1:
                ans +=1
                break
            if A[i+1] not in M[A[i]]:break

print(ans)
def read_input():
    l_1 = input()
    day = int(l_1.split(" ")[0])

    num_cake = [int(i) for i in input().split(" ")]

    return day, num_cake

def get_max_index(target_list):
    return [i for i, j in enumerate(target_list) if j == max(target_list)]


def get_second_max_index(target_list):
    return [i for i, j in enumerate(target_list) if j == list(sorted(set(target_list), reverse=True))[1]]


def mog(day, num_cake):
    """

    >>> mog(7, [3,2,2])
    0
    >>> mog(6, [1,4,1])
    1
    >>> mog(100, [100])
    99
    """
    printed = False
    previous_index = -1

    for i in range(0, day):
        # print(num_cake)
        # print(previous_index)
        ate_flag = False
        mog_maybe_index = get_max_index(num_cake)
        # print("mog_maybe_index: {0}".format(mog_maybe_index))
        for n in mog_maybe_index:
            if n == previous_index:
                continue
            else:
                num_cake[n] = num_cake[n] - 1
                ate_flag = True
                previous_index = n
                break
        if ate_flag is False:
            try:
                mog_ext = get_second_max_index(num_cake)
                # print("mog_ext", mog_ext)
            except IndexError:
                print(max(num_cake))
                printed = True
                break
            num_cake[mog_ext[0]] = num_cake[mog_ext[0]] - 1
            previous_index = mog_ext[0]

    if printed is False:
        print(0)



if __name__ == "__main__":
    import doctest
    doctest.testmod()

    mog(read_input())

### FIXED CODE ###

def read_input():
    return input()

def checker(inp_str):
    flag = 0
    for i in list(inp_str):
        if flag == 0:
            if i == "C":
                flag = 1
        if flag == 1:
            if i == "F":
                flag = 2

    if flag == 2:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    checker(read_input())
N,M = map(int,input().split()) # <=1000
xyz = [list(map(int,input().split())) for _ in range(N)]

dp = [[{'S':0,'L':[0,0,0]} for __ in range(N)]for _ in range(M+1)]
dp[1][0]['L'] = xyz[0]
dp[1][0]['S'] = abs(xyz[0][0]) + abs(xyz[0][1]) + abs(xyz[0][2])
for i in range(1,N):
    for j in range(1,min(i+2,M+1)):
        t = dp[j-1][i-1]['L']
        t = [t[0] + xyz[i][0],t[1] + xyz[i][1],t[2] + xyz[i][2]]
        ts = abs(t[0])+abs(t[1])+abs(t[2])
        if dp[j][i-1]['S'] < ts:
            dp[j][i]['S'] = ts
            dp[j][i]['L'] = t
        else:
            dp[j][i]['S'] = dp[j][i-1]['S']
            dp[j][i]['L'] = dp[j][i-1]['L']

print(dp[M][N-1]['S'])

### FIXED CODE ###

import itertools

N,M = map(int,input().split()) # <=1000
xyz = [list(map(int,input().split())) for _ in range(N)]
if  M == 0:
    print(0)
    exit()
result = 0
L = [[0] * N for i in range(8)]
for i,j in enumerate(itertools.product((-1,1),repeat=3)):
    for k,l in enumerate(xyz):
        L[i][k] = l[0] * j[0] + l[1] * j[1] + l[2] * j[2]
    L[i] = sorted(L[i],reverse=True)
print(max([sum(i[:M]) for i in L]))
a,b,c=list(input())
print(a[0],b[0],c[0])

### FIXED CODE ###

a,b,c=input().split()
print(a[0][0]+b[0][0]+c[0][0])
p = [int(x) - 1 for x in input().split()]
c = list(map(int, input().split()))
ans = -(10 ** 18)
 
for i in range(n):
    pos = i
    scores = []
    while True:
        pos = p[pos]
        scores.append(c[pos])
        if pos == i:
            break
    m = len(scores)
    s = list(accumulate(scores))
    for j in range(min(m, k)):
        x = (k - j - 1) // m
        ans = max(ans, s[j], s[j] + s[-1] * x)
 
print(ans)

### FIXED CODE ###

from itertools import accumulate 
#acumulate [a[0], a[0]+a[1], a[0]+...]
 
n, k = map(int, input().split())
p = [int(x) - 1 for x in input().split()]
c = list(map(int, input().split()))
ans = -(10 ** 18)
 
for i in range(n):
    pos = i
    scores = []
    while True:
        pos = p[pos]
        scores.append(c[pos])
        if pos == i:
            break
    m = len(scores)
    s = list(accumulate(scores))
    for j in range(min(m, k)):
        x = (k - j - 1) // m
        ans = max(ans, s[j], s[j] + s[-1] * x)
 
print(ans)
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line.split())
    det=a*e-b*d
    if(det!=0):
        x=(c*e-b*f)/det
        y=(a*f-c*d)/det
    print("{0:.3f} {1:.3f)".format(x+0, y+0))

### FIXED CODE ###

while(True):
        try:
            a,b,c,d,e,f=map(float,input().split(" "))
            z=a*e-b*d
            if(z!=0):
                x=(c*e-b*f)/z
                y=(a*f-c*d)/z
            print("{:.3f} {:.3f}".format(x+0,y+0))
        except:
            break
N,K =list(map(int,input().split()))

D = list(map(str,input().split()))

for i in range(N,100000):
    if len(set(list(str(i)))&set(D))==0:
        print(i)
        break

### FIXED CODE ###


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

D = list(map(str,input().split()))

for i in range(N,100000):
    if len(set(list(str(i)))&set(D))==0:
        print(i)
        break
N = int(input())
A = list(map(int,input().split()))

count = 0
for i in range(N):
    if A[i] < 0:
        count += 1
        
Aabs = [abs(i) for i in A]
print(sum(Aabs))

if count % 2 == 0:
    print(sum(Aabs))
else:
    mini = min(Aabs)
    print(Asum - 2*mini)

### FIXED CODE ###

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

count = 0
for i in range(N):
    if A[i] < 0:
        count += 1
        
Aabs = [abs(i) for i in A]

if count % 2 == 0:
    print(sum(Aabs))
else:
    mini = min(Aabs)
    print(sum(Aabs) - 2*mini)
import re
ptn = re.compile(r"(A|C|T|G)*")

S = input()
T = set()
for i in range(len(S)):
  for j in range(len(S)):
    x = ptn.match(S[i:i+j+1])
    if(x.group(0)):
      T.add(len(x.group(0)))
print(max(T))

### FIXED CODE ###

import re
ptn = re.compile(r"(A|C|T|G)*")

S = input()
T = set()
xx=ptn.match("FAFA")
for i in range(len(S)):
  for j in range(len(S)):
    x = ptn.match(S[i:i+j+1])
    if(x.group(0)):
      T.add(len(x.group(0)))
try:
  print(max(T))
except:
  print(0)
import math
x,y=int(input())
print(int(math.log2(y//x)+1))

### FIXED CODE ###

x,y=map(int,input().split())
for i in range(1,1000):
  x*=2
  if x>y:
    print(i)
    break
import numpy
while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        #x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
        #print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break

### FIXED CODE ###

while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        det=a*e-b*d
        x = (c*e-b*f)/det
        y = (a*f-c*d)/det
        if x==0:x=0
        if y==0:y=0
        print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break
n, k = map(int, input())

tree = [int(input()) for i in range(n)]
tree.sort()

res = (tree(i+k-1) - tree(i) for i range(n-k+1))
print(min(res))

### FIXED CODE ###

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

tree = [int(input()) for i in range(n)]
tree.sort()

res = (tree[i+k-1] - tree[i] for i in range(n-k+1))
print(min(res))
from collections import Counter
import sys
 
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ca = Counter(A)
cb = Counter(B)
if ca.most_common()[0][1] + cb.most_common()[0][1] > N:
    print('No')
    sys.exit()

print('Yes')
random.shuffle(B)

### FIXED CODE ###

from collections import Counter
import sys
import random
 
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ca = Counter(A)
cb = Counter(B)
for i in range(N+1):
    if ca[i] + cb[i] > N:
        print('No')
        sys.exit()

C = [0] * (N+1)
D = [0] * (N+1)

for i in range(N):
    C[i+1] += C[i] + ca[i+1]
    D[i+1] += D[i] + cb[i+1]

x = 0

for i in range(N):
    x = max(x, C[i+1] - D[i])

ans = [B[(i-x)%N] for i in range(N)]

print('Yes')
print(*ans)
n, k = map(int, input().split())
A = list(map(int, input().split()))

F = [0]*(k+1)
for x in range(k):
  for a in A:
    F[x] += x ^ a
print(max(F))


### FIXED CODE ###

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

fmax = 0
for i in range(40, 0, -1):
  x = 2 ** (i - 1)
  f1 = 0
  f0 = 0
  for a in A:
    a_ = a & x
    f1 += x ^ a_
    f0 += a_
  #print(i, f0, f1)
  if f0 >= f1:
    fmax += f0
  else:
    if k >= x:
      fmax += f1
      k -= x
    else:
      fmax += f0
print(fmax)
print(" ".join(sorted([int(i) for i in input().split()], reverse = True)))

### FIXED CODE ###

print(*sorted([int(i) for i in input().split()],reverse=True))
num = list( map( int, input().split() ) ) 

sorted = list.sort()

if sorted[0]+sorted[1]==sorted[2] :
  print( "Yes" )
else : 
  print( "No" )
  

### FIXED CODE ###

nums = list( map( int, input().split() ) ) 
nums.sort()

if nums[0]+nums[1]==nums[2]:
  print("Yes")
else :
  print("No")
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import bellman_ford
from scipy.sparse.csgraph import connected_components

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

row, col, val = zip(*ABC)
# -1倍しておいて最短路問題にする
val = [-(x) for x in val]
graph = csr_matrix((val,(row,col)),(N+1,N+1))

# 強連結成分に制限。ここに負閉路があればinf～
find_component_graph = csr_matrix(([1]*(M+1),(row+(N,),col+(1,))),(N+1,N+1))
# n = 個数、label=各頂点が属する連結成分のラベル[0,0,1,1,1]
n, labels = connected_components(find_component_graph,connection = 'strong')
idx = (labels == labels[1]) # [False, False, True~]
graph = graph[idx,:][:,idx]

try:
  dist = bellman_ford(graph,indices = [0])[0].astype(int)
  answer = -dist[-1]
except:
  answer = 'inf'

print(answer)

### FIXED CODE ###

import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import bellman_ford
from scipy.sparse.csgraph import connected_components

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

row, col, val = zip(*ABC)
# -1倍しておいて最短路問題にする
val = [-(x) for x in val]
graph = csr_matrix((val,(row,col)),(N+1,N+1))

# 強連結成分に制限。ここに負閉路があればinf～
find_component_graph = csr_matrix(([1]*(M+1),(row+(N,),col+(1,))),(N+1,N+1))
# n = 個数、label=各頂点が属する連結成分のラベル[0,0,1,1,1]
n, labels = connected_components(find_component_graph,connection = 'strong')
idx = (labels == labels[1]) # [False, False, True~]
graph = graph[idx,:][:,idx]

try:
  dist = bellman_ford(graph,indices = [0])[0].astype(int)
  answer = -dist[-1]
except:
  answer = 'inf'

print(answer)
a,b,c == list(map(int,input().split()))

if a == b == c:
    print(1)
elif a == b or a == c or b == c:
    print(2)
else:
    print(3)


### FIXED CODE ###

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

if a==b and b==c:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)
D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

PC1 = [[0,0,0,0]]*D
for i in range(D):
  PC1[i] = [((i+1)*100*PC[i][0]+PC[i][1])/PC[i][0], PC[i][0], (i+1)*100, PC[i][1]]

count = 0
for j in range(D):
  count += PC[j][0]
  
PC1.sort()
accum = 0
ans = 0
for i in range(count):
  if G - accum < D * (PC[D-1][0]-1)
    for j in range(PC[D-1][0]-1)
    accum += D*100
    ans += 1
    if accum >= F:
      print(ans)
      exit()
  else:
    for j in range(PC1[i][1]):
      accum += PC1[i][2]
      ans += 1
      if j == PC1[i][1]-1:
        accum += PC1[i][3]
      if accum >= G:
        print(ans)
        exit()
print(ans)
          


### FIXED CODE ###

D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

l = []
for i in range(2 ** D):
  t = 0
  c = 0
  for j in range(D):
    if ((i >> j) & 1):
      t += (j+1)*100*PC[j][0]+PC[j][1]
      c += PC[j][0]
  if t >= G:
    l.append(c)
  else:
    ck = []
    for j in range(D):
      if ((i >> j) & 1):
        continue
      else:
        ck.append(j)
    if ck == []:
      continue
    ckm = max(ck)
    for k in range(PC[ckm][0]):
      t += (ckm+1)*100
      c += 1
      if t >= G:
        l.append(c)
        break
      
print(min(l))
a=[]
for i in range(10):
    a.append(int(intpt())
a.sort()
print(a[0],a[1],a[2])

### FIXED CODE ###

s=[]
for i in range(10):
    s.append(int(input()))
s.sort()
for i in range(3):
    print(s[9-i])
print((int(input))**3/27)

### FIXED CODE ###

n = float(input())
value = pow(n,3)/27
print(value)
a,b,c,d=map(int(),input().split())
if a+b>c+d:
    print("Left")
if a+b==c+d:
    print("Balanced")
else:
    print("Right")


### FIXED CODE ###

a,b,c,d=map(int,input().split())
if a+b>c+d:
    print("Left")
if a+b==c+d:
    print("Balanced")
if a+b<c+d:
    print("Right")
X=int(input())
for i in rage(2,X):
  if(X%i==0):
    X+=1
    break
  else :
  	print X


### FIXED CODE ###

def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break