peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
A,B=map(int,input().split())
if A>=13:
  print(B)
elif 12>=A>=6:
  print(B//2)
else:
  print(0)
# Judge status: Accepted
N, X, Y = map(int, input().split())

ans = [0]*N

for i in range(1, X):
    for j in range(i+1, N+1):
        ans[min(j-i, X-i+1+abs(Y-j))] += 1

for i in range(X, Y):
    for j in range(i+1, N+1):
        ans[min(j-i,i-X+1+abs(Y-j))] += 1

for i in range(Y, N):
    for j in range(i+1, N+1):
        ans[j-i] += 1

for i in range(1, N):
    print(ans[i])
# Judge status: Accepted
from math import gcd

def main():
    k = int(input())
    ans = 0
    for i in range(1, k+1):
        for j in range(1, k+1):
            for k in range(1, k+1):
                ans += gcd(gcd(i, j), k)
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())


def head_tail(num):
    if len(str(num)) == 1:
        return (num, num)
    top = int(str(num)[0])
    tail = int(str(num)[-1])
    return (top, tail)


pairs = {}
for i in range(1, N+1):
    p = head_tail(i)
    if p not in pairs:
        pairs[p] = 1
    else:
        pairs[p] += 1

ans = 0
for i in range(1, N+1):
    pair = head_tail(i)
    re = (pair[1], pair[0])
    ans += pairs.get(re, 0)
print(ans)
# Judge status: Wrong Answer
N=int(input())
plus=[input() for i in range(N)]
M=int(input())
minus=[input() for i in range(M)]
S=list(set(plus+minus))
ans={}
for i in S:
    point=0
    point=plus.count(i)-minus.count(i)
    ans[point]=i
print(max(ans.keys()))
# Judge status: Accepted
H, A = map(int, input().split())

if H%A==0:
  ans = int(H/A)
else:
  ans = 1 + int(H/A)

print(ans)
# Judge status: Accepted
A, B = map(int,input().split())

if A >= 13:
  print(B)
elif 6 <= A <= 12:
  print(int(B*0.5))
else:
  print(0)
# Judge status: Accepted
from collections import defaultdict
import math

def combinations_count(n, r):
    if n == 1 or n == 0:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N = int(input())
A= [int(i.strip()) for i in input().split(' ')]

D =defaultdict(int)

for i in A:
    D[i] += 1

S = 0
for i in D.values():
    S += combinations_count(i,2)

result_dic ={}
for i in A:
    a = D[i] - 1
    print(S - a)
# Judge status: Wrong Answer
s = int(input())
if s < 3:
    print("0")
elif s == 3:
    print("1")
else:
    a = s -3 + 1
    aws = a - 3 + 1
    print(aws % (7 + (10 * 9)))
# Judge status: Accepted
n,m=map(int,input().split())
t=[0]*n
ans=0
temp=0
for i in range(n):
  at,bt=map(int,input().split())
  t[i]=[at,bt]
t.sort()
i=0
while True:
  if temp+t[i][1]>=m:
    ans=ans+t[i][0]*(m-temp)
    break
  else:
    ans=ans+t[i][0]*t[i][1]
    temp=temp+t[i][1]
    i=i+1
print(ans)
# Judge status: Wrong Answer
n=int(input())
temp=str(input())
templ=list(temp)
tempb=templ[len(templ)-1]
w=[0]*n
w[0]=temp
for i in range(0,n-1):
  temp=str(input())
  templ=list(temp)
  if temp in w or tempb!=templ[0]:
    print("No")
    break
  tempb=templ[len(templ)-1]
else:
  print("Yes")
# Judge status: Wrong Answer
def resolve():
    a, b, k = map(int, input().split())
    if a+k-1 <= b-k+1:
        for i in range(a, b+1):
            print(i)
    else:
        for i in range(a, a+k):
            print(i)
        for i in range(b-k+1, b+1):
            print(i)
resolve()
# Judge status: Wrong Answer
a, b = map(int,input().split())

if (a + b) <= 24:
  print(a + b)

else:
  print((a + b) - 24)
# Judge status: Accepted
N,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
if a[0]>x:
    d=a[0]-x
    ans+=d
    a[0]=x

for i in range(N-1):
    tmp=a[i]+a[i+1]
    ans+=max(tmp-x,0)
    a[i+1]=a[i+1]-max(tmp-x,0)

print(ans)
# Judge status: Wrong Answer
X, A, B = map(int, input().split())

if A >= B:
    print('delicious')
elif A + X < B:
    print('dengerous')
else:
    print('safe')
# Judge status: Accepted
x = int(input())

# 1, 2, 3, ... , nの総和がX以上ならば、
# 適当に保持をいれることでたどり着ける
# 総和の公式は(1 + n)*n//2

ans = 0
while True:
    if ((1+ans)*ans)//2 >= x:
        print(ans)
        exit(0)
    ans+=1
# Judge status: Accepted
n = int(input())
used = list(input() for x in range(n))
ans = "Yes"
for i in range(n-1): 
  if used.count(used[i]) == 2:
    ans = "No"
    break
  if used[i][-1] != used[i+1][0]:
    ans = "No"
print(ans)
# Judge status: Accepted
n,l = map(int,input().split())
a = []
for i in range(n):
    a.append(input())
a.sort()
print("".join(a))
# Judge status: Wrong Answer
n=int(input())
a=int(input())
b=int(input())
c=int(input())

print(n*b+max(0,n-a)*c)
# Judge status: Accepted
n, m = map(int, input().split())
if n == 1 and m == 1:
    print(1)
elif n == 1:
    print(m - 2)
elif m == 1:
    print(n - 2)
else:
    print((n - 2) * (m - 2))
# Judge status: Accepted
def m():
    N = int(input())
    XL = [list(map(int, input().split())) for _ in range(N)]
    ST = [[xl[0] - xl[1], xl[0] + xl[1]] for xl in XL]
    ST.sort(key=lambda x: x[1])
    ans = 1
    right = ST[0][1]
    for i in range(1, N):
        if right <= ST[i][0]:
            right = ST[i][1]
            ans += 1
    return ans


print(m())
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
        
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
'''if max_ >8:
    max_ = 8'''
if min_ <1:
    min_ = 1
print(min_, max_)
# Judge status: Accepted
A,B,C= map(int,input().split())
#print(A,B,C)
x = B // A

if x <= C :
	print( x )
else:
	print( C )
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline

def main():
    a, b, c = map(int, input().split())
    tmp = c - a - b
    if tmp <= 0:
        print("No")
    else:
        if 4 * a * b < tmp * tmp:
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
c= Counter(A)
sum = 0
for i in c.values():
    sum += i * (i - 1) // 2
for i in A:
    print(sum - c[i] + 1)
# Judge status: Accepted
import os
import math

def main():
	n,m = map(int, input().split())
	a_list = list(map(int, input().split()))
	total_check = math.ceil(sum(a_list)/(4*m))
	
	a_list.sort(reverse=True)
	flag = True
	for i in range(m):
		if a_list[i] < total_check:
			flag = False
			break
	if flag:
		print("Yes")
	else:
		print("No")


if __name__ == "__main__":
	main()
# Judge status: Accepted
from collections import Counter
n=int(input())
s=list(input())
C=Counter(s)
r,g,b=C["R"],C["G"],C["B"]
ans=r*g*b

for i in range(n-2):
    for j in range(i+1,n-1):
        k=2*j-i
        if k<=n-1 and s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
                ans-=1

print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
res = []
for a, b in AB:
    if a == 1:
        res.append(b)
    if b == N:
        res.append(a)
print('IMPOSSIBLE' if len(res) == len(set(res)) else 'POSSIBLE')
# Judge status: Accepted
n=int(input())
s=[int(input())for _ in range(n)]
ans=sum(s)

x=[]
for i in range(n):
    if s[i]%10 != 0:
        x.append(s[i])
if ans%10 != 0:
    print(ans)
elif len(x)>=1:
    print(ans-min(x))
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())
ans = ""

while n > 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26
    print(n)

print(ans[::-1])
# Judge status: Accepted
import fractions
from functools import reduce
def lcm1(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm2(*numbers):
    return reduce(lcm1,numbers,1)
n,m = map(int,input().split())
a = set(map(lambda x: int(x)//2,input().split()))
l = lcm2(*a)
for i in a:
    if l // i % 2 == 0:
        print(0)
        exit()
print(((m // l) + 1) // 2)
# Judge status: Accepted
A,B,M = map(int,input().split())

a = list(map(int,input().split()))
b = list(map(int,input().split()))
data = [0] * M
for i in range(M):
    x,y,c = map(int,input().split())
    x-=1
    y-=1
    data[i] = [x,y,c]

can = []

can.append(min(a)+min(b))

for i in range(M):
    can.append(a[data[i][0]]+b[data[i][1]]-data[i][2])

print(min(can))
# Judge status: Accepted
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"

l = [26]
for i in range(2, 14):
    a = 26 ** (i) + l[i-2]
    l.append(a)

idx = 0
while True:
    if n <= l[idx]:
        break
    idx += 1

if idx == 0:
    print(s[n-1])
    exit()

q = n - l[idx-1] - 1

ll = []
for j in range(idx+1):
    q, mod = divmod(q, 26)
    ll.append(mod)

ll.reverse()
ans = ""
for e in ll:
    ans += s[e]

print(ans)
# Judge status: Accepted
#136c
N = int(input())
H_list = [int(e) for e in input().split()]

H_list[0] -= 1 #最初の奴は減らしても影響なし。

for i in range(1,N):
    #print(H_list)
    #print(H_list[i-1],H_list[i])
    
    if H_list[i-1] < H_list[i]:
        H_list[i] -= 1
    
    if H_list[i-1] > H_list[i]:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
s=input()
a=(int(s[0])-0)*10+int(s[1])
b=(int(s[2])-0)*10+int(s[3])
if 1<=b<=12 and (12<a or a==0):
    print("YYMM")
elif 1<=a<=12 and (12<b or b==0):
    print("MMYY")
elif 1<=a<=12 and 1<=b<=12: 
    print("AMBIGUOUS")
else:
    print("NA")
# Judge status: Accepted
A1, A2, A3 = [int(_) for _ in input().split()]
if A1+A2+A3 >= 22:
    print("bust")
if A1+A2+A3 <= 21:
    print("win")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(n):
    if a[i]<0:
        s+=1
        a[i]*=-1
if s%2==0:
    print(sum(a))
else:
    a.sort()
    print(sum(a)-2*a[0])
# Judge status: Accepted
n = int(input())
a_ls = list(map(int, input().split()))
def isOK(a,b,c):
    return abs(a-b) < c < a+b
a_ls.sort()
ans = 0
for i in range(n):
    short = a_ls[i]
    r = i+1
    num = 0
    for l in range(i+1,n-1):
        while r+1 < n and isOK(short, a_ls[l], a_ls[r+1]):
            r += 1
        num += r - l
        if l == r:
            r += 1
    ans += num
print(ans)
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))
d.sort()
a = d[n // 2 - 1]
b = d[n // 2]
print(b - a)
# Judge status: Wrong Answer
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n,a,b = map(int, input().split())
Ca = cmb(n, a)
Cb = cmb(n, a)
r = (2**n - Ca - Cb) % (10**9 + 7)
print(r-1)
# Judge status: Wrong Answer
import numpy as np
W,H,N=map(int,input().split())
A=np.zeros((W,H))
B=[list(map(int,input().split())) for _ in range(N)]
print(B)
for b in B:
    if b[2]==1:
        A[:b[0],:]=1
    elif b[2]==2:
        A[b[0]:,:]=1
    elif b[2]==3:
        A[:,:b[1]]=1
    elif b[2]==4:
        A[:,b[1]:]=1
    print(A)
print(np.count_nonzero(A==0))
# Judge status: Wrong Answer
a,b = input().split()
print(a,b)
inta = int(a)
intb = int(b)
A = a * intb
B = b * inta
list = []
list.append(A)
list.append(B)
list.sort()
print(list[0])
# Judge status: Accepted
#-*-coding:utf-8-*-

import sys

def main():
    strings = input()
    replace_string=strings.replace('?','D')
    print(replace_string)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n=int(input())
d=list(map(int,input().split()))
ans=1
mod=998244353
pre=0
c=[0]*n
for dd in d:
  c[dd]+=1
max_i=0
for cc in c:
  if cc>0:
    max_i+=1
for i in range(max_i):
  if i==0:
    if c[i]==1:
      pre=c[i]
      continue
    else:
      ans=0
      break
  if c[i]!=0:
    ans*=pre**c[i]
    pre=c[i]
    ans%=mod
  elif c[i]==0:
    ans=0
    break
print(ans%mod)
# Judge status: Wrong Answer
x = int(input())
d = [[0 for i in range(110)] for j in range(110)]
e = [[0 for i in range(110)] for j in range(110)]
for i in range(110):
    d[0][i] = i**5
    d[i][0] = i**5
for i in range(1,110):
    for j in range(1,110):
        d[i][j] = d[0][j]-d[i][0]
        e[i][j] = d[0][j]+d[i][0]
for m in range(110):
    if x in d[m]:
        print(d[m].index(x),m)
        break
    elif x in e[m]:
        print(e[m].index(x),-m)
        break
# Judge status: Accepted
import math
X, Y = list(map(int, input().split()))

val = X
cnt = 1

while val <= Y:

    val *= 2
    cnt += 1

print(cnt - 1)
# Judge status: Accepted
def main():
    x, a, b = map(int, input().split())
    if abs(x-a) < abs(x-b):
        ans = 'A'
    else:
        ans = 'B'
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
def main():
  A,B,H,M = map(int, input().split())
  H_DO=(H*60+M)*360/(12*60)
  M_DO=M*6
  if(H_DO>M_DO):
    sabu=H_DO-M_DO
  elif(H_DO<M_DO):
    sabu=M_DO-H_DO
  else:
    sabu=0
  L=(A*A)+(B*B)-2*A*B*math.cos(math.radians(sabu))
  C=math.sqrt(L)
  print(C)
  
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
S = list(input())
s = list(set(S))
s.sort()
alfa = list('abcdefghijklmnopqrstuvwxyg')
ans = 0
if(len(s)==len(alfa)):
  print('None')
  sys.exit()
else:
  for i in range(len(s)):
    if(s[i]!=alfa[i]):
      print(alfa[i])
      sys.exit()
  print(alfa[len(s)+1])
# Judge status: Wrong Answer
from collections import Counter
def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    col = max(0, len(set(a)) - k)
    ac = Counter(a)
    acl = ac.most_common()[::-1]
    acll = [ace[1] for ace in acl[:col]]
    r = sum(acll)
    print(r)
# Judge status: Accepted
n, m = map(int, input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]

def c(a, m, x, y):
  tmp = []
  for i in range(m):
    tmp.append(a[y+i][x:x+m])
  return tmp

for x in range(n - m + 1):
  for y in range(n - m + 1):
    if c(a, m, x, y) == b:
      print("Yes")
      exit(0)
print("No")
# Judge status: Wrong Answer
N = int(input())
An = list(map(int, input().split()))
An = [abs(a) for a in An]
if N % 2 == 0:
  print(sum(An))
else:
  print(sum(An) - 2*min(An))
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
d=l.copy()
ans=-float("INF")
for i in range(1,n-1):
    if 0>=d[i]+d[i+1]:
        if d[i]<0:
            d[i]*=-1
            d[i+1]*=-1
        

ans=max(ans,sum(d))
l[0]*=-1
l[1]*=-1
for i in range(1,n-1):
    if 0>=l[i]+l[i+1]:
        if l[i]<0:
            l[i]*=-1
            l[i+1]*=-1
print(max(ans,sum(l)))
# Judge status: Accepted
def primes(n):
    i = 2
    prime = []
    while i**2<= n:
        if n % i:
            i += 1
        else:
            n =n//i
            prime.append(i)
    if n > 1:
        prime.append(n)
    return prime
a,b=map(int,input().split())
pa=set(primes(a))
pb=set(primes(b))
inte=pa.intersection(pb)
print(len(inte)+1)
# Judge status: Wrong Answer
s=input()
count=1
ps=s[0]
i=1
while i<len(s):
  if s[i]!=ps:
    count+=1
    ps=s[i]
    i+=1
  elif i==len(s)-1:
    break
  else:
    count+=1
    ps=s[i:i+2]
    i+=2
  print(ps)
print(count)
# Judge status: Accepted
n, T = map(int, input().split())
minc = 1001
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        minc = min(minc, c)
if minc == 1001:
    print("TLE")
else:
    print(minc)
# Judge status: Wrong Answer
n,k = map(int,input().split())
h = []
for i in range(n):
    h.append(int(input()))
h.sort()
min_number = 10**9+1
for i,j in zip(h[0:k],h[k-1:]):
    min_number = min(min_number,j-i)
print(min_number)
# Judge status: Wrong Answer
N,K=map(int,input().split())
H=list(map(int,input().split()))
cost =20000
DP=[0]*(N+10)
DP[0]=0
DP[1]=abs(H[1]-H[0])
for i in range(2,N):
  cost=20000
  for k in range(max(i-K,0),i):
    cost=min(cost,(abs(H[i]-H[k])+DP[k]))
  DP[i]=cost
print(DP[N-1])
# Judge status: Accepted
s=input()
b=s.index("A")
a=[i for i, x in enumerate(s) if x == 'Z']
print(a[-1]-b+1)
# Judge status: Wrong Answer
N=int(input())
A=str()
for i in (1,9):
    if N%i==0 and N/i<=9:
      A=("Yes")
      break
    else:
      A=("No")
print(A)
# Judge status: Wrong Answer
from math import ceil
n, h = map(int, input().split())
a, b = [0]*n, [0]*n
for i in range(n):
    aa, bb = map(int, input().split())
    a[i], b[i] = aa, bb
a_max = max(a)
b_thr = []
for i in b:
    if i > a_max:
        b_thr.append(i)
ans = 0
for i in b_thr:
    if h > 0:
        h -= i
        ans += 1
    else:
        print(ans)
        exit()
ans += ceil(h/a_max)
print(ans)
# Judge status: Accepted
from collections import defaultdict
n, m = map(int, input().split())
d = defaultdict(int)
for _ in range(m):
  a, b = input().split()
  d[a] += 1
  d[b] += 1
for i in range(n):
  print(d[str(i + 1)])
# Judge status: Accepted
N,M = map(int,input().split())
if N == 1 and M == 1:
    print(1)
elif N == 1 or M == 1:
    print(max(N,M)-2)
else:
    print((N-2)*(M-2))
# Judge status: Wrong Answer

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

if 2*k >= b+a+1:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
# Judge status: Accepted
n=int(input())
s=input()
L=len(s)
ans=0

r=s.count('R')
b=s.count('B')
g=s.count('G')

for i in range(L-2):
    for j in range(i+1,L-1):
        if s[j]!=s[i]:
            if j+j-i<=L-1:
                if s[j+j-i]!=s[i] and s[j+j-i]!=s[j]:
                    ans+=1
print(r*b*g-ans)
# Judge status: Accepted
from math import floor, ceil
A, B = [int(x) for x in input().split(" ")]

min_origin_a = ceil(A*12.5)     # contains
max_origin_a = ceil((A+1)*12.5)       # not contains

flag = False
for i in range(min_origin_a, max_origin_a):
    if floor(0.1*i) == B:
        print(i)
        flag = True
        break

if not flag:
    print(-1)
# Judge status: Wrong Answer
n = input()

if n in "9":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
X,Y=map(int,input().split())
A=4*X-Y
B=(-2)*X+Y
if A%2==0 and B%2==0 and A>=0 and B>=0:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
ALPHABET = ["a", "b", "c", "d", "e", "f", "g", "h",
            "i", "j", "k", "l", "m", "n", "o", "p",
            "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

s = input()
for i in range(26):
    if s.count(ALPHABET[i]) == 0:
        print(ALPHABET[i])
        break
else:
    print("None")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
A, B = map(int, input().split())
S = input()
if A<1 or B<1:
    print("No")
elif len(S)!=(A+B+1):
    print("No")
elif S[A]!="-":
    print("No")
else:
    s = S.replace("-", "")
    if s.isdigit():
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
x, a, b = map(int, input().split())

if a >= b:
    print("delicious")
elif x + 1 > abs(a - b):
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
N, K, Q = map(int, input().split())
ans = [0]*(N+1)
for i in range(Q):
    ans[int(input())] += 1
sum_ans = sum(ans)
for i in range(1,N+1):
    print('Yes' if K-(sum_ans-ans[i]) > 0 else 'No')
# Judge status: Wrong Answer
n=int(input())
boulist=list(map(int,input().split()))
boulist.sort(reverse=True)
print(boulist)
count=0
for i in range(n):
  for j in range(i,n):
    for k in range(j,n):
      if boulist[j] != boulist[k] and boulist[i] != boulist[j] and boulist[i]+boulist[j]>boulist[k]:
        count+=1

print(count)
# Judge status: Accepted
A, B = map(int, input().split())
ans = (B - A) // (A - 1) + 1
print(ans + 1 if (B - A) % (A - 1) else ans)
# Judge status: Accepted
from math import gcd
import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)

K = int(input())

ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        tmp = gcd(i,j)
        for k in range(1,K+1):
            ans += gcd(tmp, k)
print(ans)
# Judge status: Wrong Answer
s = input()
res = "Good"
for i in range(1,len(s),1):
    if s[i-1] == s[i]:
        res = "BAD"

print(res)
# Judge status: Accepted
import collections
import bisect

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

s = [[int(_) for _ in input().split() ] for _ in range(m)]
a = collections.defaultdict(list)

for x,y in sorted(s):
    a[x]+=[y]
for x,y in s:
    z = bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))
# Judge status: Accepted
n = int(input())

map_list = [[0,'abc',0] for i in range(n)]

for i in range(n):
    input_line = input().split()
    map_list[i]=[i,input_line[0],int(input_line[1])]

ans_li = sorted(map_list,key=lambda x:(x[1],-x[2]))
for ans in ans_li:
    print(ans[0]+1)
# Judge status: Wrong Answer
def q_e():
    n = int(input())

    if n % 2 == 1:
        print(0)
        return

    n = int(n/2)

    cc = 0
    x = 1
    x *= 5
    while n >= x:
        b = n % x
        a = int((n - b) / x)
        cc += a
        x *= 5
    print(cc)

if __name__ == '__main__':
    q_e()
# Judge status: Wrong Answer
import sys
N = int(input().split()[0])
a = [int(i) for i in input().split()]
print(N, a)

def lcm(a, b):
    x = a * b
    if a < b:
        tmp = a
        a = b
        b = tmp
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    return x / b

l = a[0]
for i in range(1, N):
    l = lcm(l, a[i])

ans = 0
MOD = 1000000007
for i in range(N):
    ans = (ans + l / a[i]) % MOD

print(int(ans))
# Judge status: Accepted
a,b,c=map(int,input().split())
if(b-a)==(c-b):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, k = map(int, input().split())
W, V = [0], [0]
for _ in range(n):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

dp = [[0]*(k+1) for _ in range(n+1)]

for i in range(1, n+1):
    for w in range(1, k+1):
        if w - W[i] >= 0:
            dp[i][w] = max(dp[i-1][w], dp[i-1][w-W[i]] + V[i])
        else:
            dp[i][w] = dp[i-1][w]
            
print(max(dp[-1]))
# Judge status: Accepted
s=raw_input()
flag=0
s1=s[::-1]
# print s1
if s1!=s:
  print "No"
  exit(0)
s1=s[0:(len(s)-1)/2]
s2=s1[::-1]
# print s1
if s1!=s2:
  print "No"
  exit(0)

print "Yes"
# Judge status: Accepted
def main():
    A, B, C, K = map(int, input().split())

    if A > K:
        return print(K)

    if A + B >= K:
        return print(A)
    else:
        C = K - A - B
        return print(A-C)

if __name__ == '__main__':
    main()
# Judge status: Accepted
d,n = map(int,input().split())
if n == 100:
  print(101*(100**d))
else:
  print(n*(100**d))
# Judge status: Accepted
a, b, x, y = map(int, input().split())

ans = 0
if x + x == a and y + y == b:
    ans = 1
else:
    ans = 0
print(a * b / 2, ans)
# Judge status: Accepted
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

N = int(input())
ans = ""
while N:
    ans = str(N&1)+ans
    N = -(N>>1)
print(ans if ans else 0)
# Judge status: Wrong Answer
ans = 0
for s in reversed(input()):
    n = int(s)
    if n < 6:
        ans += n
        ans += n % 10
        nxt = False
    else:
        ans += (10 - n) + 1

print(ans)
# Judge status: Accepted
a, b = map(int,input().split())
if a % 3 == 0:
  print('Possible')
elif b % 3 == 0:
  print('Possible')

elif (a + b) % 3 == 0:
  print('Possible')
else:
  print('Impossible')
# Judge status: Wrong Answer
# coding: utf-8
N, A, B = map(int, input().split())

if A == 0 or N == 0:
    print(0)
else:
    num = int(N / (A + B)) * A
    #print("num:", num)
    num += N % (A + B)
    # print("num:", num)
    
    print(num)
# Judge status: Accepted
q,h,s,d = map(int,input().split())
n = int(input())
h = min(q*2,h)
s = min(h*2,s)

if 2*s <= d:
    print(n*s)
else:
    print(n//2*d+(n%2)*s)
# Judge status: Wrong Answer
a,b,c,d=map(int, input().split())
 
x=a if abs(a)>abs(b) else b
y=c if abs(c)>abs(d) else d
 
if ( (x>0 and y>0) or (x<0 and y<0) ):
  print (x*y)
else :
  x=a if abs(a)<abs(b) else b
  y=c if abs(c)<abs(d) else d
  print (x*y)
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = [set()] * 3
    S[0] = {1, 3, 5, 7, 8, 10, 12}
    S[1] = {4, 6, 9, 11}
    S[2] = {2}

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

    ans = 'No'
    for s in S:
        if x in s and y in s:
            ans = 'Yes'
            break

    print(ans)
    return


if __name__ == '__main__':
    main()