Harryxun/stf_run huggingface dataset:
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
    
    else:
        x = 10-a%10
        ans += a + x
        t.append(x)
    
ans -= max(t)
print(ans)

### FIXED CODE ###

t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
        t.append(0)
    
    else:
        x = 10-a%10
        ans += a + x
        t.append(x)
    
ans -= max(t)
print(ans)
k=input()  
odd=1
even=0
for i in range(2,k+1): 
     if i%2==0:
        even+=1
     else:
           odd+=1
print(odd*even)

### FIXED CODE ###

n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))
import re
def validate(text):
  match=re.search(r'(...)\1{2,}', text)
  return match.group(),match.start()

n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=1
count=''
for j in range(11):
  ans=a[ans-1]
  count+=str(ans)
#print(validate(count)[0][:3],validate(count)[1])
ans=1
for i in range((k-validate(count)[1])%len(validate(count)[0][:3])+validate(count)[1]):
  ans=a[ans-1]
print(ans)

### FIXED CODE ###

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

p=1
if k<=n:
  for i in range(k):
    p=a[p-1]
  print(p)
  exit()

t=[-1]*n
t[0]=0
for i in range(1,n):
  p=a[p-1]
  if t[p-1] !=-1:
    break
  t[p-1]=i

d=i-t[p-1]
k-=i
k%=d
for i in range(k):
  p=a[p-1]
print(p)
print("win" if sun(map(int,input().split()))<=21 else "bust")

### FIXED CODE ###

print("win" if sum(map(int,input().split()))<=21 else "bust")
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[1]+c3[2]
e = c1[1]+c2[2]+c3[0]
f = c1[2]+c2[0]+c3[1]
if a=b=c=d=e=f:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a==b==c==d==e==f:
  print('Yes')
else:
  print('No')
import math
 
a = list(map(int,input().split()))
 
c = reduce((lambda x,y: (x+y)/2 ,a)
 
print(math.cell(c))

### FIXED CODE ###

import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2))
N = int(input())
print(N+N**2+N***3)

### FIXED CODE ###

N = int(input())
print(N+N**2+N**3)
n = input()
R = []

for i in range(1,n):
    R.append(input())
 
max = R[1] - R[0]
min = R[0]
 
for i in range(2,n):
    if R[i]-min>max:
        max = R[i] - min
    if R[i]<min:
        min = R[i]
 
print max

### FIXED CODE ###

n = input()

R = [input() for i in range(n)]
  
max = R[1] - R[0]
min = R[0]
  
for i in range(1,n):
    if R[i] - min > max:
        max = R[i] - min
    if R[i] < min:
        min = R[i]
  
print max
N,M =[int(i)for i in input().split()]
oya =[[]for i in range(N)]
ko =[[] for i in range(N)]
dabu =set()
for i in range(N+M-1):
    A,B = [int(i)for i in input().split()]
    oya[B-1].append(A-1)
    ko[A-1].append(B-1)
    if len(oya[B-1]) > 1:
        dabu.add(B-1)
print(oya,ko)
tyouten =oya.index([])
rank =[-1]*N
def keisan(num,no):
    rank[num] =max(rank[num],no)
    for i in ko[num]:
        keisan(i,no+1)

keisan(tyouten,0)
for k,i in enumerate(oya):
    if i ==[]:
        print(0)
    else:
        for j in i:
            if rank[k]==rank[j]+1:
                print(j+1)


### FIXED CODE ###

import queue
N,M =[int(i)for i in input().split()]
adlist =[[]for i in range(N)] #隣接リスト
oyalist =[[]for i in range(N)] #親ノードリスト
for _ in range(N+M-1):
    A,B =[int(i)-1 for i in input().split()]
    adlist[A].append(B)
    oyalist[B].append(A)

iri =[0]*N #入次数のリスト
for i in range(N):
    iri[i] =len(oyalist[i])

topo =[0]*N #トポロジカルソートの番号
tyouten =oyalist.index([]) #頂点
num = 0 #ソート番号
q =queue.Queue()
q.put(tyouten)
topo[tyouten]=num

while num != N-1:
    now = q.get()
    for i in adlist[now]:
        iri[i] -=1
        if iri[i] == 0:
            q.put(i)
            num += 1
            topo[i] =num

#出力
oyalist[tyouten].append(-1)
for i in range(N):
    oyalist[i] =sorted(oyalist[i],key=lambda x:topo[x],reverse=True)
    print(oyalist[i][0]+1)
ABC = sorted(list(map(int,input().split())))
K = int(input())

print(sum(ABC[:2]) + (ABC[-1] * 2( **  K))

### FIXED CODE ###

ABC = sorted(list(map(int,input().split())))
K = int(input())

print(sum(ABC[:2]) + (ABC[-1]) * (2 ** K))
s=list(str(input()))
q=int(input())
now = 0
for _ in range(q):
  lis = list(map(str,input().split()))
  if int(lis[0]) == 1:
    now = (now+1)%2
  else:
    if (int(lis[1])+now)%2 == 1:
      s.insert(lis[2],0)
    else:
      s.append(lis[2])
if now ==1:
  print(*s)
else:
  for i in range(len(s)):
    print(s[-i-1],end="")
    
  

### FIXED CODE ###

s=str(input())
q=int(input())
now = 0
mae,usiro="",""
for _ in range(q):
  lis = list(map(str,input().split()))
  if int(lis[0]) == 1:
    now = (now+1)%2
  else:
    if (int(lis[1])+now)%2 == 1:
      mae = lis[2]+mae
    else:
      usiro= usiro +lis[2]
s = mae+s+usiro
if now ==0:
  print(s)
else:
  print(s[::-1])
n = input()
a = list(map(int, input().split()))
for i in range(n):
    while True:
        a[i] = a[i]/2
        if a[i]%2!=0:
            break

print(min(a))


### FIXED CODE ###

print(input().count("1"))
n = input()
m = input()
if n=0 or n=1:
  print(math.factorial(m))
if m=0 or m=1:
  print(math.factorial(n))
else:
  print(math.factorial(n+m))

### FIXED CODE ###

n,m = map(int,input().split())
print(int(n*(n-1)/2 + m*(m-1)/2))
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = input()

pre = [[] for i in range(((n-1)//k))]
for i in range(n):
    pre[i%k].append(t[i])
#print(pre)

def score(h):
    c_r = 0
    c_s = 0
    c_p = 0
    num = "".join(h)
    count = 1
    result = ''

    # 配列全体のループ
    for i in range(len(num)):
        try:
            if num[i] == num[i+1]:
                count = count + 1
            else:
                result = result + str(num[i]) + str(count)
                count = 1
        except:
            # 最後の文字セットがOutOfRangeになるので結果に出力
            result = result + str(num[i]) + str(count)
    
    for i in range(len(result)//2):
        ko = result[2*i]
        wa = int(result[(2*i)+1])
        if wa%2 == 0:
            if ko == "r":
                c_r += wa//2
            elif ko == "s":
                c_s += wa//2
            else:
                c_p += wa//2
        else:
            if ko == "r":
                c_r += 1 + (wa-1)//2
            elif ko == "s":
                c_s += 1 + (wa-1)//2
            else:
                c_p += 1 + (wa-1)//2


    return c_r * p + c_s * r + c_p * s

ans = 0
for i in range(len(pre)):
    ans += score(pre[i])
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = input()

pre = [[] for i in range(k)]

for i in range(n):
    #print(i, pre[i%k], t[i])
    pre[i%k].append(t[i])
#print(pre)

def score(h):
    c_r = 0
    c_s = 0
    c_p = 0
    num = "".join(h)
    count = 1
    result = ''

    # 配列全体のループ
    for i in range(len(num)):
        try:
            if num[i] == num[i+1]:
                count = count + 1
            else:
                result = result + str(num[i]) + str(count)
                ko = num[i]
                wa = count 
                if wa%2 == 0:
                    if ko == "r":
                        c_r += wa//2
                    elif ko == "s":
                        c_s += wa//2
                    else:
                        c_p += wa//2
                else:
                    if ko == "r":
                        c_r += 1 + (wa-1)//2
                    elif ko == "s":
                        c_s += 1 + (wa-1)//2
                    else:
                        c_p += 1 + (wa-1)//2
                count = 1
        except:
            # 最後の文字セットがOutOfRangeになるので結果に出力
            result = result + str(num[i]) + str(count)
            ko = num[i]
            wa = count 
            if wa%2 == 0:
                if ko == "r":
                    c_r += wa//2
                elif ko == "s":
                    c_s += wa//2
                else:
                    c_p += wa//2
            else:
                if ko == "r":
                    c_r += 1 + (wa-1)//2
                elif ko == "s":
                    c_s += 1 + (wa-1)//2
                else:
                    c_p += 1 + (wa-1)//2

    #print(result,c_r * p + c_s * r + c_p * s )
    return c_r * p + c_s * r + c_p * s

ans = 0
for i in range(len(pre)):
    ans += score(pre[i])
print(ans)
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    int_inputs = list(map(string_to_int, inputs))
    N = len(inputs) // 2
    reds = int_inputs[:N]
    blues = int_inputs[N:]

    reds.sort(key=lambda x: x[0])
    blues.sort(key=lambda x: x[0])

    count = 0
    for i in range(N):
        candidates = []
        for j in range(len(blues)):
            if blues[j][0] > reds[i][0] and blues[j][1] > reds[i][1]:
                candidates.append([j, *blues[j]])
        if len(candidates) > 0:
            candidates.sort(key=lambda x: x[2])
            blues.pop(candidates[0][0])
            count += 1

    return count


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N*2))
    print(ret)


### FIXED CODE ###

import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    int_inputs = list(map(string_to_int, inputs))
    N = len(inputs) // 2
    reds = int_inputs[:N]
    blues = int_inputs[N:]

    reds.sort(key=lambda x: x[0])
    blues.sort(key=lambda x: x[0])

    count = 0
    for bi in range(N):
        candidates = []
        for ri in range(len(reds)):
            if blues[bi][0] > reds[ri][0] and blues[bi][1] > reds[ri][1]:
                candidates.append([ri, reds[ri][0], reds[ri][1]])
        if len(candidates) > 0:
            candidates.sort(key=lambda x: x[2])

            reds.pop(candidates[-1][0])
            count += 1

    return count


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N*2))
    print(ret)
n = input()
a = map(int, input().split())
min = a[0]
max = a[0]
sum = 0
for i in range(n):
    if min > a[i]:
        min = a[i]
    if max < a[i]:
        max = a[i]
    sum += a[i]
print min, max, sum

### FIXED CODE ###

n = input()
a = map(int, raw_input().split())
min = a[0]
max = a[0]
sum = 0
for i in range(n):
    if min > a[i]:
        min = a[i]
    if max < a[i]:
        max = a[i]
    sum += a[i]
print min, max, sum
m,n=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=0
for j in range(n):
  s+=a[j]
for i in range(n):
  if a[n-i] < s/(4*m):
    if i!=0:
      a=a[n-i+1:]
      break
    else:
      a=[]
      break
if len(a) >= m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))[::-1]
print("Yes" if 4*m*a[m-1]>=sum(a) else "No")
def main():
	import math
	a,b,c,d = map(int,input().split())
	ans = 0
	
	e = (c*d) / math.gcd(c,d)

	i = int(b/c)
	t = int(b/d)
	l = int(b/e)

	while a <= i * c <= b:
		ans += 1
		i -= 1

	while a <= t * d <= b:
		ans += 1
		t -= 1
	
	while a <= l * e <= b:
		ans -= 1
		l -= 1

	print(int(len(range(a,b+1)))-ans)

if __name__ == "__main__":
	main()

### FIXED CODE ###

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

	#about c
	ans_c_a = (a-1)//c
	ans_c_b = b//c
	# print(ans_c_b)
	ans_c = ans_c_b - ans_c_a
	# print("ans_c = {}".format(ans_c))

	#about d
	ans_d_a = (a-1)//d
	ans_d_b = b//d
	ans_d = ans_d_b - ans_d_a
	# print("ans_d = {}".format(ans_d))

	#aboud c*d
	import fractions
	saisyou = (c * d) // fractions.gcd(c,d)
	# print(saisyou)
	ans_saisyou_a = (a-1)//saisyou
	ans_saisyou_b = b//saisyou
	ans_saisyou = ans_saisyou_b - ans_saisyou_a
	# print("ans_saisyou = {}".format(ans_saisyou))

	print(int( b-a+1 - (ans_c + ans_d - ans_saisyou) ))


if __name__ == '__main__':
	main()
import math
R = int(input)

print(2*math.pi*R)

### FIXED CODE ###

import math
R = int(input())
 
print(2*math.pi*R)
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

h,w,d=nii()

a_dict={}
for i in range(h):
  a=lnii()
  for j in range(w):
    a_dict[a[j]]=(i,j)

b_dict={}
for i in range(1,h*w):
  if i-d<=0:
    b_dict[i]=0
  else:
    oy,ox=a_dict[i-d]
    ny,nx=a_dict[i]
    b_dict[i]=b_dict[i-d]+abs(ny-oy)+abs(nx-ox)

q=int(input())
for i in range(q):
  l,r=nii()
  ans=b_dict[r]-b_dict[l]
  print(ans)

### FIXED CODE ###

from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

h,w,d=nii()

a_dict={}
for i in range(h):
  a=lnii()
  for j in range(w):
    a_dict[a[j]]=(i,j)

b_dict={}
for i in range(1,d+1):
  num=i
  cy,cx=a_dict[num]
  b_dict[num]=0
  while num+d<=h*w:
    num+=d
    ny,nx=a_dict[num]
    b_dict[num]=b_dict[num-d]+abs(cy-ny)+abs(cx-nx)
    cy=ny
    cx=nx

q=int(input())
for i in range(q):
  l,r=nii()
  ans=b_dict[r]-b_dict[l]
  print(ans)
import sys 
cnt =1
while 1:
    x = sys.stdin.strip()
    if x == "0":
        break;
    print("Case %d: %s"%(cnt,x))
    cnt+=1

### FIXED CODE ###

import sys 

cnt =1

while 1:
    x = sys.stdin.readline().strip()
    if x == "0":
        break

    print("Case %d: %s"%(cnt,x))
    cnt+=1
n = int(input())
mod = 10**9 + 7
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)

### FIXED CODE ###

n = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)
import itertools as it

def c(n,k):
  if k>n:
    return 0
  ret = 1
  for i in range(n, n-k, -1):
    ret *= i
  for i in range(k, 1, -1):
    ret /= i
  return ret


n = int(input())
dic = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for person in range(n):
  name = input()
  if name[0] in 'MARCH':
    dic[name[0]] += 1

answer = 0
for a,b,c = it.combinations('MARCH', 3):
  answer += dic[a] * dic[b] * dic[c]
print(answer)

### FIXED CODE ###

import itertools as it

def c(n,k):
  if k>n:
    return 0
  ret = 1
  for i in range(n, n-k, -1):
    ret *= i
  for i in range(k, 1, -1):
    ret /= i
  return ret


n = int(input())
dic = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for person in range(n):
  name = input()
  if name[0] in 'MARCH':
    dic[name[0]] += 1

answer = 0
for a,b,c in it.combinations('MARCH', 3):
  answer += dic[a] * dic[b] * dic[c]
print(answer)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from collections import deque
import bisect
import sys

# 準備
idx = 0
charcode_mapper = {}
for ch in "abcdefghijklmnopqrstuvwxyz":
    charcode_mapper[ch] = idx
    idx += 1

s = input().strip()  # e.g., "contest"
t = input().strip()  # e.g., "son"
# s = "contest"
# t = "son"
# t = "programming"
# t = "sentence"

# s 中の文字の出現順序を保持する (本当は一行でできそう)
# こういうリストを作る (イメージ)
# [
#     [x, y],  # a の出現位置
#     [z],     # b の出現位置
#     ...,
#     [i, j]   # z の出現位置
# ]
char_idx = 0
char_positions = [[] for _ in range(26)]  # 26文字分


def extend_char_positions():
    global char_idx
    for ch in s:
        char_positions[charcode_mapper[ch]].append(char_idx)
        char_idx += 1


extend_char_positions()
extend_char_positions()

# print(charcode_mapper)
# print(char_positions)

# idx を 0 とする
# t の文字をなめていき、char_positions の idx より先にその文字が存在するかどうか確認する
#   あれば)
#     idx をそこまで進める
#     `(len(s)  - idx) < len(t)` であれば char_positions を伸ばす
#   なければ)
#     return -1

idx = 0
for ch in t:
    charcode = charcode_mapper[ch]
    idx = bisect.bisect_left(
        char_positions[charcode],
        idx,
        0,
        len(char_positions[charcode])
    )
    # print(ch)  # s
    # print(char_positions[charcode])  # [5, 12]
    try:
        idx = char_positions[charcode][idx]
    except Exception:
        print('-1')
        sys.exit(1)
    # print(idx)
    if len(s) - idx < len(t):
        extend_char_positions()


print(idx + 1)


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from bisect import bisect_left

s = input().strip()  # e.g., "contest"
t = input().strip()  # e.g., "son"
# s = "contest"
# t = "son"
# t = "programming"
# t = "sentence"

# 文字列 s 二周分の文字の出現位置マップを作る
s_map = [[] for _ in range(26)]
for i, ch in enumerate((s + s)):
    s_map[ord(ch) - ord('a')].append(i)

# t を舐めながら回答を作る
p = ans = 0
for ch in t:
    ch_position_list = s_map[ord(ch) - ord('a')]
    if len(ch_position_list) == 0:
        print('-1')
        sys.exit()

    p = ch_position_list[bisect_left(ch_position_list, p)] + 1
    if len(s) <= p:
        ans += len(s)
        p -= len(s)

ans += p
print(ans)
def walking():
    x, k, d = map(int, input().split())
    r = 0
    if x > 0 and x > k * d:
        return x - k * d
    elif x < 0 and x < -k * d:
        return x + k * d
    elif x > 0 and x < k * d:
        r = x//d
        if (k - r)%2 == 0:
            return x - r * d
        else:
            return x - (r + 1 ) * d
    elif x < 0 and x < -k * d:
        r = x//d
        if (k - r)%2 == 0:
            return x - r * d
        else:
            return x - (r + 1 ) * d        
    
loc = walking()
print(abs(loc))

### FIXED CODE ###


def walking():
    x, k, d = map(int, input().split())
    x = abs(x)
    r = 0
    if x > k * d:
        return x - k * d
    else:
        r = x//d
        if (k - r)%2 == 0:
            return x - r * d
        else:
            return abs(x - (r + 1 ) * d)
    
loc = walking()
print(loc)
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

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

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

N, K = LI()

# 逆に考える
"""
X = gcd(A_1, A_2,...A_K)
となるようなXを考えると溶ける
X = 3の時その個数は
[K/3]**N
"""

x_cnt = [0 for i in range(K + 1)]
for x in range(N, 0, -1):
    # print(x)
    tmp = pow(K // x, N, mod)
    for x_n in range(x + x, N+1, x):
        tmp -= x_cnt[x_n]
    x_cnt[x] = tmp % mod

ans = 0
for i in range(1,K+1):
    ans += i * x_cnt[i]
    ans %= mod
print(ans)


    



### FIXED CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

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

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

N, K = LI()

# 逆に考える
"""
X = gcd(A_1, A_2,...A_K)
となるようなXを考えると溶ける
X = 3の時その個数は
[K/3]**N
"""

x_cnt = [0] * (K + 1)
for x in range(K, 0, -1):
    # print(x)
    tmp = pow(K // x, N, mod)
    for j in range(x + x, K+1, x):
        tmp -= x_cnt[j]
    x_cnt[x] = tmp

ans = 0
for i in range(1,K+1):
    ans += i * x_cnt[i]
    ans %= mod
print(ans)
N = int(input())
S = input()
a = 0

for L in range(N):
  left = S[:L]
  right = S[L:]
  both = set(left)&set(right)
  answer = max(answer,len(both))

print(answer)


### FIXED CODE ###

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

answer = 0
for L in range(N):
  left = S[:L]
  right = S[L:]
  both = set(left) & set(right)
  answer = max(answer, len(both))

print(answer)
H,W=map(int, input().split())
field=[[0]*(W+1) for i in range(H+1)]
List=[list(input()) for i in range(H)]

for k in range(1,H):
    for j in range(1,W):
        field[k][j] = List[k-1][j-1]

#print(field)

flag=1

for i in range(1,W):
    for j in range(1,H):
        if field[k][j]=='#' and field[k-1][j]!='#' and field[k+1][j]!='#' and field[k][j-1]!='#' and field[k][j+1]!='#':
            print('No')
            flag=0
            exit()

if flag==1:     
    print('Yes')

### FIXED CODE ###

H,W=map(int,input().split())
S=["."+input()+"." for i in range(H)]
field=["."*(W+2)]+S+["."*(W+2)]

flag=0

for k in range(1,H+1):
    for j in range(1,W+1):
        if field[k][j]=='#' and field[k-1][j]!='#' and field[k+1][j]!='#' and field[k][j-1]!='#' and field[k][j+1]!='#':
            flag=1

if flag==1:
    print('No')
else:     
    print('Yes')
N=int(input())
s=[int(input()) for _ in range(N)]
M=int(input())
t=[int(input()) for _ in range(M)]
l=list(set(N))
print(max(0,max(s.count(l[i])-t.count(l[i]) for i in range(len(l))))

### FIXED CODE ###

N=int(input())
s=[input() for _ in range(N)]
M=int(input())
t=[input() for _ in range(M)]
l=list(set(s))
print(max(0,max(s.count(l[i])-t.count(l[i]) for i in range(len(l)))))
n,q = int(input().split(' '))
str = input()
for i in range(q):
  s,e = int(input().split(' '))
  tmp = s[s-1:e]
  ans = tmp.count('AC')
  print(ans)

### FIXED CODE ###

n,q = map(int,input().split())
str = input()
q = int(q)
dic = {}

for j in range(len(str)):
  if (j > 0):
    if (str[j-1] == 'A' and str[j] == 'C'):
      dic[j] = dic[j-1] + 1
    else:
      dic[j] = dic[j-1]
  else:
    dic[j] = 0

for i in range(q):
  s,e = map(int,input().split())
  ans = dic[e-1] - dic[s-1]
  print(ans)
import copy
from math import gcd


# def gcd(a, b):
#     if b == 0:
#         return a
#     else:
#         return gcd(b, a%b)

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

def main():
    n, m = map(int, input().split())
    # これだと72がREになる
    A = [int(x) for x in input().split()]
    # A_s = set(A)
    # A_ = copy.deepcopy(A)
    # a_lcm = A.pop()
    a_lcm = 1
    # Aの要素が複数ならlcmを計算する
    #if len(A) >= 1:
    for i in range(n):
        a_lcm = lcm(a_lcm, A[i])
    # mがlcmの半分よりも小さかったら0
    if (a_lcm / 2) > m:
    # if a_lcm > m * 2:
        print(0)
        exit()
    # for a in A:
    for i in range(n):
        if a_lcm / 2 % A[i] == 0:
        # if (a_lcm // a) % 2 == 0: 
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
314159265 3

### FIXED CODE ###

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

while n > 0:
    n = n // k
    count += 1

print(count)