Harryxun/stf_run huggingface dataset:
stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  # applies to only numbers
rs = lambda: stdin.readline().rstrip()  # ignores trailing space

N = ri()

if N&1:
    print(0)
    exit()

answer = N // 10

while N >= 50:
    answer += (N // 50)
    N //= 50
print(answer)

### FIXED CODE ###

import sys

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  # applies to only numbers
rs = lambda: stdin.readline().rstrip()  # ignores trailing space

N = ri()

if N&1:
    print(0)
    exit()

answer = N // 10
x = 50
while N >= x:
    answer += (N // x)
    x *= 5
print(answer)
IN = iter(Input.split('\n')).__next__
def input():
    return IN()

import itertools
def my_index(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

H,W,M=map(int,input().split())
P=list()
P_X=[0]*(H+1)
P_Y=[0]*(W+1)
for m  in range(M):
    P.append(list(map(int,input().split())))
    P_X[P[m][0]]+=1
    P_Y[P[m][1]]+=1
Max_X=max(P_X)
Max_Y=max(P_Y)
max_X=my_index(P_X,Max_X)
max_Y=my_index(P_Y,Max_Y)
m_count=0
for k in P:
    if  k[0] in max_X and k [1] in max_Y:
        m_count += 1
if m_count==len(max_X)*len(max_Y):
    answer=Max_X+Max_Y-1
else:
     answer=Max_X+Max_Y
    
print(answer)

    



### FIXED CODE ###


def my_index(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

H,W,M=map(int,input().split())
P=list()
P_X=[0]*(H+1)
P_Y=[0]*(W+1)
for m  in range(M):
    P.append(list(map(int,input().split())))
    P_X[P[m][0]]+=1
    P_Y[P[m][1]]+=1
Max_X=max(P_X)
Max_Y=max(P_Y)
max_X=my_index(P_X,Max_X)
max_Y=my_index(P_Y,Max_Y)
m_count=0
for k in P:
    if  P_X[k[0]] == Max_X and P_Y[k [1]] == Max_Y:
        m_count += 1
if m_count==len(max_X)*len(max_Y):
    answer=Max_X+Max_Y-1
else:
     answer=Max_X+Max_Y
    
print(answer)
a,b,c=map(int,imput().split())
if a+b+c >= 22
   print("bust")
    else:
      print("win")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+c >= 22:
   print("bust")
else:
   print("win")
int = int(input()) #iを取得し、intに値を入れる
S = 3*int**2
return S

### FIXED CODE ###

i = int(input())
print(3*i**2)
import fractions

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

def mass_gcd(L):
    # num is 1
    if len(L) == 1:
        return L[0]
    else:
        max_gcd = fractions.gcd(L[0], L[1])

    # solve gcd
    for _ in range(1, len(L) - 1):
        max_gcd = max(max_gcd, fractions.gcd(L[i], L[i + 1]))
    return max_gcd

ans = mass_gcd(A)
for i in range(0, N):
    left = A[:i]
    right = A[(i + 1):]
    if len(left) == 0:
        pass
    elif len(right) == 0:
        pass
    else:
        ans = max(ans, fractions.gcd(mass_gcd(left), mass_gcd(right)))
print(ans)

### FIXED CODE ###

import fractions

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

# correct
L = [0] * N
R = [0] * N

for i in range(1, N):
    L[i] = fractions.gcd(L[i - 1], A[i - 1])
for j in range(0, N-1)[::-1]:
    R[j] = fractions.gcd(R[j + 1], A[j + 1])
ans = 0
for k in range(N):
    ans = max(ans, fractions.gcd(L[k], R[k]))
print(ans)
def lcs():
???x = raw_input()
  y = raw_input()
???x_len = len(x)
  y_len = len(y)
  z2 = [0 for i in range(y_len+1)]

???for j in range(x_len):
   z2 = z1 + []
   for k in range(y_len):
      if x[i] == y[k]:
         z1[k+1] = z2[k] + 1
      elif z1[k+1] < z1[k]:???
?????????   z1[k+1] = z1[k]

  return z1[-1]

num = input()
for l in range(num):
  print lcs()

### FIXED CODE ###

def lcs():
  x = raw_input()
  y = raw_input()
  x_len = len(x)
  y_len = len(y)
  z2 = [0 for i in range(y_len+1)]

  for i in range(x_len):
    z1 = z2 + []
    ele = x[i]
    for k in range(y_len):
      if ele == y[k]:
        z2[k+1] = z1[k] + 1
      elif z2[k+1] < z2[k]:
        z2[k+1] = z2[k]

  return z2[-1]

num = input()
for j in range(num):
  print lcs()
k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

b = a[0] + (k - a[n-1])

c = [a[i]-a[i-1] for i in range(1,n)]

d = max(b,c)

print(d)


### FIXED CODE ###

k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
c = a[0] + (k - a[n-1])
for i in range(1,n):
  c = max(c,a[i] - a[i-1])
print(k-c)
#from operator import mul
#from functools import reduce
cnt = 1000000000000000000
ans =1
N = map(int, input().split())
nums = list(map(int, input().split()))


count  = reduce(mul, nums)
if "0" in N:
        print("0")
for  num in nums
    ans *= num
        if count  > cnt :
        print(-1)

print(count)


### FIXED CODE ###

#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

if 0 in nums:
        print(0)
        exit()
for num in nums:
    ans *= num
    if ans > 10**18 :
        print(-1)
        exit()
print(ans)
s = input()
t = input()

if s in t and len(s) = len(t) +1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
t = input()

if(s == t[:-1]):
    print("Yes")
else:
    print("No")
n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

visited = [0]
x=1
for i in range(n):
  x = a[i]
  if x in visited:
    for j in range(i):
      if visited[j] == x:
        first = j
        break
    T = i - j
  else:
    visited.append(a[i])
mod = (k-first) % T
print(a[first+mod])


### FIXED CODE ###

n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

visited = [-1 for i in range(n+1)] # 訪れていたら訪れたときの添字を格納する。
points = []
p = 1
while visited[p] == -1:
  visited[p] = len(points)
  points.append(p)
  p = a[p-1] #添字に直す

T = len(points) - visited[p]
s = visited[p]

if k < s:
  print(points[k])
else:
  mod = (k - s) % T
  print(points[s+mod])
from sys import stderr, setrecursionlimit, exit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1, flag=False):
    res = []
    for _ in range(n):
        line = [int(i) for i in input().split()]
        if flag or len(line) == 1:
            res.append(line[0])
            flag = True
        else:
            res.append(line)
    if n == 1:
        return res[0]
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

def solve(s, a, n):
    if s % 10 != 0:
        return s
    

n = f()
s = f(n)
s.sort(reverse=True)
su = sum(s)
# 10で割り切れるなら一番小さいやつを引く
# それでもだめなら2つ目，それもだめなら3つ目
# ↑1つ目≡0(mod 10),2つ目≡0(mod 10)なら当然1つ目+2つ目≡0(mod 10)なので3つ目のみ検討すればOK
if su % 10 != 0:
    print(su)
    exit()
i = -1
while True:
    su -= s[i]
    if su % 10 != 0:
        print(su)
        exit()
    su += s[i]
    i -= 1
    if i < -n:
        print(0)
        exit()


### FIXED CODE ###

from sys import stderr, setrecursionlimit, exit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1, flag=False):
    res = []
    for _ in range(n):
        line = [int(i) for i in input().split()]
        if flag or len(line) == 1:
            res.append(line[0])
            flag = True
        else:
            res.append(line)
    if n == 1:
        return res[0]
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

n = f()
s = []
for i in range(n):
    s.append(int(input()))
s.sort(reverse=True)
su = sum(s)
# 10で割り切れるなら一番小さいやつを引く
# それでもだめなら2つ目，それもだめなら3つ目
# ↑1つ目≡0(mod 10),2つ目≡0(mod 10)なら当然1つ目+2つ目≡0(mod 10)なので3つ目のみ検討すればOK
if su % 10 != 0:
    print(su)
    exit()
i = -1
while True:
    su -= s[i]
    if su % 10 != 0:
        print(su)
        exit()
    su += s[i]
    i -= 1
    if i < -n:
        print(0)
        exit()
from collections import defaultdict
from fractions import Fraction
def powmod(x, n,mod):
 if n == 0:
  return 1
 K = 1
 while n > 1:
  if n % 2 != 0:
   K = K * x%mod
   x = x ** 2%mod
   n = (n - 1) // 2
  else:
   x = x ** 2%mod
   n = n // 2%mod
  return K * x # 指数を割り続け n が 1 に至ったら終了
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in [0]*N:
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  if k>0:
   dic[Fraction(A,B)][0]+=1
  else:
   dic[-1/Fraction(A,B)][1]+=1
ans=1
for k in dic:
 ans*=(powmod(2,dic[k][0],mod)+powmod(2,dic[k][1],mod) -1)
 ans%=mod
ans*=(powmod(2,c,mod)+powmod(2,d,mod)-1)
print((ans-1+e)%mod)

### FIXED CODE ###

from collections import defaultdict
from math import gcd
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in [0]*N:
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  g=gcd(A,B)
  A//=g
  B//=g
  if A*B>0:
   dic[(abs(A),abs(B))][0]+=1
  else:
   dic[(abs(B),abs(A))][1]+=1
ans=1
for k in dic:
 ans=ans*(pow(2,dic[k][0],mod)+pow(2,dic[k][1],mod) -1)
ans=ans*(pow(2,c,mod)+pow(2,d,mod)-1)
print((ans-1+e)%mod)
n, m, c - [int(i) for i in input().split(' ')]
b = [int(i) for i in input().split(' ')]

r = 0
for i in range(n):
  a = [int(i) for i in input().split(' ')]
  s = 0
  for j in range(m):
    s += a[j] * b[j]
  s += c
  if s > 0:
    r += 1
  
print(r)

### FIXED CODE ###

n, m, c = [int(i) for i in input().split(' ')]
b = [int(i) for i in input().split(' ')]
 
r = 0
for i in range(n):
  a = [int(i) for i in input().split(' ')]
  s = 0
  for j in range(m):
    s += a[j] * b[j]
  s += c
  if s > 0:
    r += 1
  
print(r)
N = input()
inp = input()
listA = inp.split(' ')
count = 0
for moji in lintA:
  youso = listA.count(moji)
  if youso == 1:
    count += 1
  else:
    print('NO')
    break
if count == len(listA):
  print('YES')

### FIXED CODE ###

N = int(input())
inputA = input()
listA = inputA.split(' ')
listA.sort()
output = 'YES'
for i in range (len(listA) - 1):
    if listA[i] == listA[i + 1]:
        output = 'NO'
print(output)
n = int(input())
ans = 1
while n >= 2:
    n = n // 2
    ans *= 2
print(ans)

### FIXED CODE ###

a, b , c, d = list(map(int, input().strip().split()))
lst = []
lstt = []
for i in range(a, b + 1):
    lst.append(i)

for i in range(c, d+1):
    lstt.append(i)

one = set(lst)
two = set(lstt)

inter = one & two
if len(inter)-1 > 0:
    print(len(inter)-1)
else:
    print(0)
import numpy as np
k,x = map(int,input().split())

result = np.linspace(x-k+1,x+k-1,k*2-1,dtype = 'int')
print(result)

### FIXED CODE ###

import numpy as np
k,x = map(int,input().split())

result = np.arange(x-k+1,x+k,1,dtype = 'int')

for i in range(len(result)):
    print(result[i],end = " ")
N = input()
while True:
    dic = {}
    for i in range(N):
        lis = raw_input().split()
        dic[lis[0]] = [3*int(lis[1])+int(lis[3]), N-i]
    
    for k, v in sorted(dic.items(), key=lambda x: (x[0][0], x[0][1]), reverse=True):
        print '%s,%s' % (k, v[0])

    N = input()
    if N == 0: break
    print

### FIXED CODE ###

N = input()
while True:
    dic = {}
    for i in range(N):
        lis = raw_input().split()
        dic[lis[0]] = [3*int(lis[1])+int(lis[3]), N-i]
    
    for k, v in sorted(dic.items(), key=lambda x: (x[1][0], x[1][1]), reverse=True):
        print '%s,%s' % (k, v[0])

    N = input()
    if N == 0: break
    print
n=int(input())
if n==1:
  print("Hello World")
else:
  a,b=[int(input()), for i in range(2)]
  print(a+b)
  

### FIXED CODE ###

n=int(input())
if n==1:
  print("Hello World")
else:
  a,b=[int(input()) for i in range(2)]
  print(a+b)
#coding:utf-8

elements[] = input().split()
w = elements[0]
h = elements[1]
x = elements[2]
y = elements[3]
r = elements[4]

if x<=0 OR y<=0:
    print("No")

elif x>=r AND y>=r:
    if x+r<=w AND y+r<=h:
        print("Yes")
else:
    print("No")



### FIXED CODE ###

# coding: utf-8
# Your code here!

#coding:utf-8

elements = input().split()
w = int(elements[0])
h = int(elements[1])
x = int(elements[2])
y = int(elements[3])
r = int(elements[4])

if x<=0 or y<=0:
    print("No")

elif x>=r and y>=r and x+r<=w and y+r<=h:
        print("Yes")
else:
    print("No")
X=int(input())
if 30<=X<=40:
   print("Yes")
elif:-40<=X<30
   print("No")


### FIXED CODE ###

X=int(input(""))
if 30<=X:
   print("Yes")
else:
   print("No")
import math
k=int(input())
print((k//2)*(math.celi(k//2)))


### FIXED CODE ###

import math
k=int(input())
print((k//2)*(math.ceil(k/2)))
import math
from itertools import combinations, chain

def gcd(numbers):
  gcds = numbers.__next__()
  for x in numbers:
    gcds = math.gcd(gcds, x)
  return gcds

def main():
  N = int(input().strip())
  A = list(map(int, input().strip().split()))
  
  gcds = []
  for i in range(N):
    gcds.append(gcd(chain(A[:i], A[i+1:])))
  
  print(max(gcds))
 
if __name__ == '__main__':
  main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
import math
from fractions import gcd
import operator
from functools import reduce
from itertools import accumulate

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def prime_factorization_preprocess(n):
    """
    エラトステネスの篩を用いて、sqrt(n)以下の素数を列挙する
    """
    m = math.floor(math.sqrt(n)) + 1
    primes = []
    is_prime = [True for i in range(m)]
    for i in range(2, m):
        if is_prime[i]:
            primes.append(i)
            for j in range(i+i, m, i):
                is_prime[j] = False
    return primes


def prime_factorization(x, primes):
    """
    試し割り法により、数値の素因数分解を求める
    """
    factors = defaultdict(int)
    for p in primes:
        if x % p == 0:
            n = 0
            while x % p == 0:
                x //= p
                n += 1
            factors[p] = n
    return factors


def solve(N, A, AMAX = 10**9, INF=10**9):
    sl = list(accumulate(A, gcd))
    sr = list(reversed(list(accumulate(reversed(A), gcd))))
    max_gcd = sl[-1]
    for i in range(N):
        # gcdの単位元は0
        v = 0
        if i > 0:
            v = gcd(v, sl[i-1])
        if i < N-1:
            v = gcd(v, sr[i+1])
        max_gcd = max(max_gcd, v)
    return max_gcd


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))
import collections
n=int(input())
s=[]
for _ in range(n):
    s.append(str(input()))
ans=collections.Counter(s)
a=max(ans.values())
ans=[i for i,k in ans.items() if a==k]
print(*ans.sort(),sep="\n")

### FIXED CODE ###

import collections
n=int(input())
s=[]
for _ in range(n):
    s.append(str(input()))
ans=collections.Counter(s)
a=max(ans.values())
ans=[i for i,k in ans.items() if a==k]
print(*sorted(ans),sep="\n")
a,b,k = map(int,input().split())
if a-k >= 0;
	print(a)
elif  a+b-k=< 0;
	print(0)
else;
	print(0)

### FIXED CODE ###

a,b,k = map(int,input().split())
if a+b-k <= 0:
  print(0,0)
elif a-k <= 0:
  print(0,b+a-k)
else:
  print(a-k,b)
r=int(input())
py=3.14159265358979
area=py*r*r
longht=py*2*r
print(area,longht)


### FIXED CODE ###

from math import pi

r=float(input())
print("{:.7f}".format(pi*r*r),"{:.7f}".format(2*r*pi))
n, l = map(int, input().split())

s = []

for i in range(l) :
    s.append(input())

s.sort()

print(*s, sep='')

### FIXED CODE ###

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

s = []

for i in range(n) :
    s.append(input())

s.sort()

print(*s, sep='')
L,R = list(map(int,input().split()))
Y = []
for i in range(L, R):
    if i == 0:
        j = 1
        Y.append((i * j) % 2019)
    elif i * j == 2019:
        Y.append(0)
    else:
        for j in range(i+1, R+1):
            Y.append((i * j) % 2019)
print(min(Y))


### FIXED CODE ###

L,R = list(map(int,input().split()))
def main(L,R):
    mod_min = 2019
    if L // mod_min == R // mod_min:
        L %= mod_min
        R %= mod_min
        for i in range(L,R):
            for j in range(i+1, R+1):
                Y = i*j % 2019
                if Y < mod_min:
                    mod_min = Y
    else:
        mod_min = 0
    return mod_min
print(main(L,R))
N = int(input())
P = [list(map(int, input().split())) for i in range(N)]

INF = 10**18

L = max(r for l, r in P)
S = [0]*L
l0, r0 = P[0]
for i in range(L):
    S[i] = abs(i - (l0-1))
for i in range(N-1):
    l0, r0 = P[i]
    l1, r1 = P[i+1]
    T = [0]*L
    for x in range(L):
        r = INF
        for y in range(max(0, x-(r0-l0)), min(L, x+(r1-l1)+1)):
            r = min(r, S[y])
        T[x] = abs(x-(l1-1)) + r
    S = T
print(min(S))

### FIXED CODE ###

# seishin.py
N = int(input())
P = [list(map(int, input().split())) for i in range(N)]

INF = 10**18

from heapq import heappush, heappop

l0, r0 = P[0]

L = [-l0+1]
R = [l0-1]
s = t = 0

def debug(L, s, t, R):
    L0 = L[:]
    Q1 = []; Q2 = []
    while L0:
        Q1.append(-s-heappop(L0))
    R0 = R[:]
    while R0:
        Q2.append(t+heappop(R0))
    print("debug:", *Q1[::-1]+Q2)


#print(L, s, t, R)
res = 0
for i in range(N-1):
    l0, r0 = P[i]
    l1, r1 = P[i+1]
    #print(">", l1, r1)
    s += (r1 - l1); t += (r0 - l0)
    if -s-L[0] <= l1-1 <= t+R[0]:
        #print(0)
        heappush(L, -l1+1-s)
        heappush(R, l1-1-t)
        # res += 0
    elif l1-1 < -s-L[0]:
        #print(1)
        heappush(L, -l1+1-s)
        heappush(L, -l1+1-s)
        p = -heappop(L)-s
        #d = (-L[0]-s) - p
        heappush(R, p-t)
        #print(d)
        #res += d
        res += (p - (l1-1))
    elif t+R[0] < l1-1:
        #print(2)
        heappush(R, l1-1-t)
        heappush(R, l1-1-t)
        p = heappop(R) + t
        #d = R[0]+t - p
        heappush(L, -p-s)
        #print(d)
        res += (l1-1 - p)
    #print(L, s, t, R, -s-L[0], R[0]+t, res)
    #debug(L, s, t, R)
print(res)
n = int(input())
li1 = list(map(int, input().split()))

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []
li4 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        li4.append(cnt2)
        cnt1 = 0
    else:
        cnt1 += 1
    if cnt2 == len(li2):
        li3.append(cnt1)
        li4.append(cnt2)

print(max(li3))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
li1 = list(map(int, input().split()))

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        cnt1 = 0
    else:
        cnt1 += 1

li3.append(cnt1)

print(max(li3))
mport math
a,b,c,d = map(int,input().split(" "))
taka = math.ceil(c/b)
aoki = math.ceil(a/d)

if taka <= aoki:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math
a,b,c,d = map(int,input().split(" "))
taka = math.ceil(c/b)
aoki = math.ceil(a/d)

if taka <= aoki:
    print("Yes")
else:
    print("No")
from math import sqrt
while 1:
	n = int(raw_input())
	if n == 0:
		break
	ub = int(sqrt(n))
	square_sum = [[0 for i in range(n+1)] for j in range(4)]
	for k in range(1,ub+1):
		square_k = k**2
		square_sum[0][square_k] = 1
		for j in range(3):
			for i in range(1, n+1 - square_k):
				if square_sum[j][i] >= 1:
					square_sum[j+1][i+square_k] += square_sum[j][i]
	print sum([square_sum[j][n] for j in range(4)])
	

### FIXED CODE ###

from math import sqrt
MAX = 2**15-1
ub = int(sqrt(MAX))
square_sum = [[0 for i in range(MAX)] for j in range(4)]
for k in range(1,ub+1):
	square_k = k**2
	square_sum[0][square_k-1] = 1 
	for j in range(3):
		for i in range(1,MAX - square_k + 1):
			if square_sum[j][i-1] >= 1:
				square_sum[j+1][i-1+square_k] += square_sum[j][i-1]
while 1:
	n = int(raw_input())
	if n == 0:
		break
	print sum(square_sum[i][n-1] for i in range(4))
from fractions import gcd
N, M = map(int, input().split())
an = list(map(int, input().split()))

l = an[0]
for a in an[1:]:
    LCM = l*a//gcd(l, a)
    if LCM//l % 2 == LCM//a % 2 == 1:
        lcm = LCM
    else:
        print(0)
        exit()
print((M//lcm+1)//2)


### FIXED CODE ###

import fractions
from functools import reduce
import numpy as np
import sys

N, M = map(int, input().split())
an = list(map(int, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def listdivide(list):
    numpy = np.array(list)
    numpy = numpy//2
    return numpy.tolist()


def divide2(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


# while gcd_list(an) % 2 == 0:
#     print(gcd_list(an))
an = listdivide(an)

t = divide2(an[0])
for i in range(1, N):
    if divide2(an[i]) != t:
        print(0)
        sys.exit()

for i in range(t):
    an = listdivide(an)
    M = M // 2

LCM = lcm_list(an)

if LCM > M == 0:
    print(0)
else:
    print(-(-(M // LCM)//2))
import sys


def main():
    a, b = [int(s) for s in sys.stdin.readline().strip().split()]

    def gcd(x, y):
        while y:
            x, y = y, x % y
        return x

    def divisors(n, d, ans):
        if n == 1:
            return
        if n % d == 0:
            ans.append(d)
            divisors(n // d, d, ans)
        else:
            divisors(n, d+1, ans)

    gcd_val = gcd(a, b)
    divs = []
    divisors(gcd_val, 2, divs)

    ans = 1
    for div in sorted(list(divs)):
        if div == 1:
            continue
        if gcd_val % div == 0:
            ans += 1
            while gcd_val % div == 0 and gcd_val > 1:
                gcd_val = gcd_val // div
    print(ans)


main()


### FIXED CODE ###

import sys
import math

def main():
    a, b = [int(s) for s in sys.stdin.readline().strip().split()]

    def factorize(x):
        ret = set()
        for n in range(2, int(math.sqrt(x))+2):
            if x % n == 0:
                while x % n == 0:
                    x //= n
                ret.add(n)
        if x != 1:
            ret.add(x)
        return ret

    a_primes = factorize(a)
    b_primes = factorize(b)
    shared = a_primes.intersection(b_primes)
    print(len(shared) + 1)


main()
import sys
n=int(input())
a=[int(input()) for _ in range(n)]
       
cnt=0
tmp=1

for i in range(n):
    cnt+=1
    already.append(tmp)
    tmp=a[tmp-1]
    if tmp==2:
        print(cnt)
        sys.exit()
print(-1)

### FIXED CODE ###

import sys
n=int(input())
a=[int(input()) for _ in range(n)]
       
cnt=0
tmp=1

for i in range(n):
    cnt+=1
    tmp=a[tmp-1]
    if tmp==2:
        print(cnt)
        sys.exit()
print(-1)
a,b,c=map(int,input()split("/"))
print("Heisei" if b*10+c>=70 else "TBD")
  

### FIXED CODE ###

a,b,c=map(int,input().split("/"))
print("Heisei" if b*100+c<=430 else "TBD")
import sys
from heapq import heappop as p
sys.setrecursionlimit(9**9)
n=int(input())
T=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    T[a-1].append([b-1,i])
C=[0]*(n-1)
m=max(map(lambda x:len(x),T))
print(m)
def f(Q):
    R=[]
    for q in Q:
        H=list(range(1,m+1))
        for t in T[q[0]]:
            x=p(H)
            if x==q[1]:
                x=p(H)
            C[t[1]]=x
            if len(T[t[0]])!=0:
                R.append([t[0],x])
    if len(R)!=0:
        return f(R)
f([[0,0]])
for c in C:
    print(c)

### FIXED CODE ###

import sys
sys.setrecursionlimit(9**9)
n=int(input())
T=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    T[a-1].append([b-1,i])
C=[0]*(n-1)
def f(i,r):
    c=1
    for (x,y) in T[i]:
        c+=(c==r)
        C[y]=c
        f(x,c)
        c+=1
f(0,0)
print(max(C))
for c in C:
    print(c)
n, l = map(int, input().split())
ls = [i+l-1 for i in range(1, n+1)]

if l >= 0:
    ls.pop(0)
elif n >= abs(l):
    ls.pop(abs(l))
else:
    ls.pop(-1)

print(sum(ls))


### FIXED CODE ###

n, l = map(int, input().split())
ls = [i+l-1 for i in range(1, n+1)]

ls.remove(min(ls, key=abs))
print(sum(ls))
A,B=map(int,input().split())
print(6-A-B)


### FIXED CODE ###

A=int(input())
B=int(input())
print(6-A-B)