Harryxun/stf_run huggingface dataset:
Sl = list(input())

def func(n, s):
    n += 1
    if n==len(Sl)-1:
        a = sum([int(i) for i in (s+Sl[n]).split("+")])
        b = sum([int(i) for i in (s+"+"+Sl[n]).split("+")])
        return a + b
    else:
        return func(n, s+Sl[n]) + func(n, s+"+"+Sl[n])

print(func(0, Sl[0]))

### FIXED CODE ###

S = input()
n = len(S)

def SplitSum(i, t):
    if i == n-1:
        return sum(list(map(int, t.split('+'))))
    
    return SplitSum(i+1, t+S[i+1]) + SplitSum(i+1, t+'+'+S[i+1])

print(SplitSum(0, S[0]))
# -*- coding: utf-8 -*-
 
if “o” == "S"[:1] :
   x = 1
    
if “o” == "S"[1:2] :
   x = x + 1
 
if “o” == "S"[2:3] :
   x = x + 1
 
y = 700 + x * 100
 
print str(y)

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()
a = s.count('o')
y = 700 + 100 * a
print(y)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans = a[i]-b[i]
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans += a[i]-b[i]
print(ans)
S = input()
N = len(S)
c = [1 for _ in range(N)]

dic = {}
freq = 0
start = 0
for i in range(int(N ** 0.5):
  tmp = [0 for _ in range(N)]
  for j in range(N):
    if j > 0 and S[j - 1] == "R":
      tmp[j] += c[j - 1]
    if j < N - 1 and S[j + 1] == "L":
      tmp[j] += c[j + 1]
  c = tmp
  if str(c) in dic.keys():
    freq = i - dic[str(c)]
    start = dic[str(c)]
    break
  else:
    dic[str(c)] = i

n = start + ((10 ** 100 - start - 1) % freq)
key = [k for k, v in dic.items() if v == n][0]
key = key.replace("[", "").replace("]", "")
k = list(key.split(", "))
for i in range(N):
  print(k[i], end = "")
  if i == N - 1:
    print()
  else:
    print(" ", end = "")

### FIXED CODE ###

S = input()
N = len(S)

ans = []
RL = []
s = "R"
flag = False
for i in range(1, N):
  if S[i] == "L" or S[i] == "R" and S[i - 1] == "R":
    s += S[i]
  else:
    RL.append(s)
    s = "R"
RL.append(s)

for rl in RL:
  for i in range(len(rl)):
    if rl[i] == "R" and rl[i + 1] == "L" or rl[i] == "L" and rl[i - 1] == "R":
      if i % 2 == 1:
        ans.append(len(rl) // 2)
      else:
        ans.append((len(rl) + 1) // 2)
    else:
      ans.append(0)

for i in range(N):
  print(ans[i], end = "")
  if i == N - 1:
    print()
  else:
    print(" ", end = "")
N, M = map(int, input().split())
AB = {}

for _ in range(N):
    a, b = map(int, input().split())
    AB.setdefault(a, b)

AB = sorted(AB.items(), key=lambda x:x[0])

sum = 0
ans = 0
for i in range(N):
    sum += AB[i][1]
    ans += AB[i][1] * AB[i][0]
    if sum > M:
        ans -= (sum - M) * AB[i][0]
        break

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
AB = []

for _ in range(N):
    a, b = map(int, input().split())
    AB.append([a, b])

AB = sorted(AB)


sum = 0
ans = 0
for i in range(N):
    sum += AB[i][1]
    ans += AB[i][1] * AB[i][0]
    if sum >= M:
        ans -= (sum - M) * AB[i][0]
        break

print(ans)
N = int(input())
S = [input() for i in range(N)]
S.sort()
maxi = 0
ans = []
total_count = 0
while total_count != N:
  tmp = S.count(S[total_count])
  total_count += tmp
  if maxi < tmp:
    maxi = tmp
    ans.clear()
    ans.append(S[total_count])
  elif maxi == tmp:
    ans.append(S[total_count])
for i in range(len(ans)):
  print(ans[i])
    
  

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]
S.sort()
maxi = 0
tmp = 1
ans = []
for i in range(N-1):
  if S[i] == S[i+1]:
    tmp += 1
  else:
    if tmp > maxi:
      maxi = tmp
      ans.clear()
      ans.append(S[i])
    elif tmp == maxi:
      ans.append(S[i])
    tmp = 1
  if i == N-2:
      if S[i] == S[i+1]:
        if tmp > maxi:
          maxi = tmp
          ans.clear()
          ans.append(S[i])
        elif tmp == maxi:
          ans.append(S[i])
      else:
        if maxi == 1:
          ans.append(S[N-1])
for i in range(len(ans)):
  print(ans[i])
s,w  =int(input())
if s <= w:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

s,w  =map(int, input().split())
if s <= w:
    print("unsafe")
else:
    print("safe")
x,a,b=map(int,input())
print('AB'[abs(a-x)>abs(b-x)])

### FIXED CODE ###

x,a,b=map(int,input().split())
print('AB'[abs(a-x)>abs(b-x)])
import math
a, b = map(int, input().split())
print(a * b // math.gcd(a, b))

### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
N, M, K = map(int, input().split())

A = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))

# dp[i][j] = Aをi冊、Bをj冊読んだ時のcost、costがkを超えない範囲で i + jの最大値を求める
# dp[0][0] = 0

dp = [[0] * (M+1) for _ in range(N+1)]

# どうやって増やしていけばいいんだ ??
# recursionかな
ans = 0
def recur(i, j, cost):
    global ans
    if cost > K:
        return
    ans = max(ans, i + j)
    dp[i][j] = cost

    if i + 1 < len(A):
        recur(i+1, j, dp[i][j]+A[i+1])
    if j + 1 < len(B):
        recur(i, j+1, dp[i][j]+B[j+1])
    return

recur(0, 0, 0)
print(ans)


### FIXED CODE ###

# 再帰は深くなりすぎる
N, M, K = map(int, input().split())

A = list(map(int, input().split()))
B = list(map(int, input().split()))
accum_A, accum_B = [0] * (len(A)+1), [0] * (len(B)+1)
for i in range(len(A)):
    accum_A[i+1] = accum_A[i] + A[i]
for i in range(len(B)):
    accum_B[i+1] = accum_B[i] + B[i]

ans = 0
i, j = len(A), 0
while i >= 0 and j <= len(B) :
    if accum_A[i] + accum_B[j] > K:
        i -= 1
    else:
        ans = max(ans, i+j)
        j += 1

print(ans)
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)



### FIXED CODE ###

from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)
k = int(input())

if k == 7:
    ans = 1
elif k % 2 == 0:
    ans = -1
else:
    for i in range(1, (len(str(k)) * 3) + 1):
        tgt = int("7" * i)
        if tgt % k == 0:
            ans = i
            break

print(ans)

### FIXED CODE ###

print("Yes") if int(input()) >= 30 else print("No")
a,b,c = map(int,input().spit())
if b <= a:
  print(No)
elif c <= b:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

a,b,c = map(int,input().split())
if b <= a:
  print('No')
elif c <= b:
  print('No')
else:
  print('Yes')
a, b, k = map(int, input().split())
divs = []

for i in range(1, int(max(a, b))):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

### FIXED CODE ###

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

for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
            print(i)
n = int(input())
s = list(input())

i = 1
nowcolor = s[0]
while(True):
    if nowcolor == s[i]:
        del s[i]
    else:
        nowcolor = s[i]
        i += 1
    if len(s) == i:
        break
print(len(s))

### FIXED CODE ###

n = int(input())
s = list(input())

ans_list = [s[0]]
now_color = s[0]
for i in range(1, n):
    if now_color != s[i]:
        ans_list.append(s[i])
        now_color = s[i]
    # print("s[{}]:{} now_color:{} ans_list:{}".format(i, s[i], now_color, ans_list))

print(len(ans_list))
def judge(t,x,y,t0,x0,y0):
  minT=abs(x-x0)+abs(y-y0)
  return (t-t0-minT)>=0 and (t-t0-minT)%2==0
n=int(input())
lst=[tuple(int(i) for i in input().split()) for i in range(n)]
t0=0;x0=0;y0=0
num=0;bool=False
while num<=n-1:
  t,x,y=lst[num]
  if judge(t,x,y,t0,x0,y0):
    t0=t;x0=x;y0=y
    t,x,y=lst[num+1]
    num+=1
    bool=True
  else:
    bool=False
    break
if bool:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

def judge(t,x,y,t0,x0,y0):
  minT=abs(x-x0)+abs(y-y0)
  if (t-t0-minT)>=0 and (t-t0-minT)%2==0:
    return True
  else:
    return False
n=int(input())
lst=[tuple(int(i) for i in input().split()) for i in range(n)]
t0=0;x0=0;y0=0
for i in range(n):
  t,x,y=lst[i]
  if judge(t,x,y,t0,x0,y0):
    t0=t;x0=x;y0=y
    ans=True
  else:
    ans=False
    break
if ans:
  print('Yes')
else:
  print('No')
N,M = (int(x) for x in input().split())

#魔法実行回数
magic_act_num = 0

known = [False for x in range(N)]
judge = 0
for i in range(M):
	x,y,z = (int(x) for x in input().split())

	# zは気にしなくてよい
	if i == 0:
		known[x]=True
		known[y]=True
		judge += 2
		magic_act_num+=1
	else:
		if known[x] == True:
			if known[y] == True:
				continue
			else:
				known[y] = True
				judge += 1
		else:
			if known[y] == True:
				known[x] = True
				judge += 1
			else:
				known[x] = True
				known[y] = True
				judge += 2
				magic_act_num+=1

magic_act_num += (N-judge)

print(magic_act_num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

class UnionFind:
    def __init__(self, num):
        self.p = [x for x in range(num)]
    def root(self, x):
        if self.p[x] == x:
            return x
        else:
            self.p[x] = self.root(self.p[x])
            return self.p[x]
    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx != ry:
            self.p[ry] = rx

def main():
    N, M = (int(x) for x in input().split())
    u = UnionFind(N)

    for i in range(M):
        x,y,_ = map(int, input().split())
        u.unite(x-1, y-1)

    rlist = set()
    for i in range(N):
        rlist.add(u.root(i))

    print(len(rlist))

if __name__ == '__main__':
    main()
word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)
iterV=(int)(lent/2)
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] == wordArray[lent-1]):
       #print(" if Num:",num)
    else:      
       print(" else temp:",temp)
       wordArray[i]=wordArray[lent-1]      
       print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
   
lent=lent-1
#print(" else Num:",num)
#print(" else lent:",lent)

print(num)

### FIXED CODE ###

word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)

iterV=(int)(lent/2)

if(lent%2==0):
 iterV=iterV+1
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] != wordArray[lent-1]):       
       wordArray[i]=wordArray[lent-1]      
       #print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
    lent=lent-1
#print(" else Num:",num)
#print(" else lent:",lent)

print(num)
from heapq import heapify,heappop,heappush
xs,ys,xt,yt=map(int,input().split())
P=[]
inf=float("inf")
P.append((xs,ys,0))
N=int(input())
for i in range(N):
  x,y,r=map(int,input().split())
  P.append((x,y,r))
P.append((xt,yt,0))
G=[set() for i in range(N+2)]
for i in range(N+2):
  for j in range(N+2):
    if i!=j:
      x1,y1,r1,x2,y2,r2=P[i][0],P[i][1],P[i][2],P[j][0],P[j][1],P[j][2]
      d=((x1-x2)**2+(y1-y2)**2)**(1/2)
      if d<=r1+r2:
        G[i].add((0,j))
      else:
        G[i].add((d-r1-r2,j))

def dijkstra(s,n,links):
  cost=[inf]*n
  cost[s]=0
  heap=[(0,s)]
  heapify(heap)
  while heap:
    hc,hp=heappop(heap)
    for c,p in links[hp]:
      if c+hc<cost[p]:
        cost[p]=c+hc
        heappush(heap,(cost[p],p))
  return cost        

c=dijkstra(0,N+2,G)
print(c[-1])

### FIXED CODE ###

N,x=map(int,input().split())
A=[int(i) for i in input().split()]
ans=0
if A[0]+A[1]>x:
  if A[0]>x:
    ans+=A[1]+A[0]-x
    A[1],A[0]=0,x
  else:
    ans+=A[1]-x+A[0]
    A[1]=x-A[0]
for i in range(1,N):
  if A[i-1]+A[i]>x:
    ans+=A[i-1]+A[i]-x
    A[i]=x-A[i-1]
print(ans)
li = input()
c = 0
for i in range(0,3):
  if li[i]=='1':
    c++
    
print(c)

### FIXED CODE ###

li = list(input())
c = 0
for i in [0,1,2]:
  if li[i]=='1':
    c = c +1
    
print(c)
import sys
 
print(sys.argv[1] ** 3)

### FIXED CODE ###

print(int(input())**3)
import math
li = list(map(int,input().split()))
countC = li[1] // li[2] - (li[0]-1) // li[2]

countD = li[1] // li[3] - (li[0]-1) // li[3]

lcm = (li[2] * li[3]) // math.gcd(li[2], li[3])

countCD = li[1] // lcm - (li[0]-1) // lcm

re = (li[1] - li[0] + 1) - (countC +countD - countCD)

print(re)


### FIXED CODE ###

import fractions
li = list(map(int,input().split()))
countC = li[1] // li[2] - (li[0]-1) // li[2]

countD = li[1] // li[3] - (li[0]-1) // li[3]

lcm = (li[2] * li[3]) // fractions.gcd(li[2], li[3])

countCD = li[1] // lcm - (li[0]-1) // lcm

re = (li[1] - li[0] + 1) - (countC +countD - countCD)

print(re)
i=int(input())
j=int(input())
ls=list(range(1,3))
ls.remove(i)
ls.remove(j)
a=ls.pop(0)
print(a)


### FIXED CODE ###

i=int(input())
j=int(input())
a=6-(i+j)
print(str(a))
from collections import deque

def topological_sort(V, to):
    cnt = [0]*V
    for i in range(V):
        for j in to[i]:
            cnt[j] += 1
    Q = deque(i for i in range(V) if cnt[i]==0)
    res = []
    while len(Q) > 0:
        i = Q.popleft()
        res.append(i)
        for k in to[i]:
            cnt[k] -= 1
            if cnt[k] == 0:
                Q.append(k)
    return s

N,M = map(int,input().split())
to = [[] for i in range(N)]
From = [[] for i in range(N)]
for i in range(N-1+M):
    x, y = list(map(int,input().split()))
    to[x-1].append(y-1)
    From[y-1].append(x-1)
s = topological_sort(N, to)
s = [(s[i],i) for i in range(N)]
s.sort()
for i in range(N):
    k = -1
    I = -1
    for j in From[i]:
        if k < s[j][1]:
            k = s[j][1]
            I = j
    print(I+1)

### FIXED CODE ###

from collections import deque

def topological_sort(V, to):
    cnt = [0]*V
    for i in range(V):
        for j in to[i]:
            cnt[j] += 1
    Q = deque(i for i in range(V) if cnt[i]==0)
    res = []
    while Q:
        i = Q.popleft()
        res.append(i)
        for k in to[i]:
            cnt[k] -= 1
            if cnt[k] == 0:
                Q.append(k)
    return res

N,M = map(int,input().split())
to = [[] for i in range(N)]
From = [[] for i in range(N)]
for i in range(N-1+M):
    x, y = list(map(int,input().split()))
    to[x-1].append(y-1)
    From[y-1].append(x-1)
s = topological_sort(N, to)
s = [(s[i],i) for i in range(N)]
s.sort()
for i in range(N):
    k = -1
    I = -1
    for j in From[i]:
        if k < s[j][1]:
            k = s[j][1]
            I = j
    print(I+1)
def gcd(l, r):
  while r > 0:
    l, r = r, l % r
  return l

def main():
  N, K, *A = map(int, open(0).read().split())
  if N == 1:
    if K == A[0]:
      print('POSSIBLE')
      return
    else:
      print('IMPOSSIBLE')
      return
  g = A[1] - A[0]
  for i in range(N-1):
    g = gcd(g, abs(A[i+1] - A[i]))
  if K % g == A[0] % g and K <= max(A):
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')

if __name__ == '__main__':
  main()


### FIXED CODE ###

def gcd(l, r):
  while r > 0:
    l, r = r, l % r
  return l

def main():
  N, K, *A = map(int, open(0).read().split())
  g = A[0]
  for a in A:
    g = gcd(g, a)
  if K % g == 0 and K <= max(A):
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')

if __name__ == '__main__':
  main()
import math
import sys
sys.setrecursionlimit(100000000)
N = int(input())
ll = []

for i in range(N):
    l = list(input())
    l.sort()
    s = ''.join(l)
    ll.append(s)
ll.sort()
k = 0
ans = 0
for j in range(N-1):
    if ll[j]==ll[j+1]:
        k += 1
    elif k>0:
        ans += math.factorial(k+1)/math.factorial(2)/math.factorial(k+1-2)
        k = 0
if k>0:
    ans += math.factorial(k+1)/math.factorial(2)/math.factorial(k+1-2)
print(int(ans))

### FIXED CODE ###

import math
from operator import mul
from functools import reduce
N = int(input())
ll = []
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

for i in range(N):
    l = list(input())
    l.sort()
    s = ''.join(l)
    ll.append(s)
ll.sort()
k = 0
ans = 0
for j in range(N-1):
    if ll[j]==ll[j+1]:
        k += 1
    elif k>0:
        ans += cmb(k+1, 2)
        k = 0
if k>0:
    ans += cmb(k+1, 2)
print(int(ans))
b=0
i=0
if K%2==0:
  print(-1)
else:
  while True:
    a=10**i
    b=b+7*a
    i+=1
    if b%K==0:
      print(i)
      break

### FIXED CODE ###

K=int(input())
i=1
if K%2==0 or K%5==0:
  print(-1)
elif K%7==0:
  L=9*K/7
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
else:
  L=9*K
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
X = int(input())

if X = 3 or X = 5 or X = 7:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

X = int(input())

if X == 3 or X == 5 or X == 7:
  print('YES')
else:
  print('NO')
A_list = []

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

for i in range(3):
  a, b, c = map(int, input().split())
  A_list.append(a)
  A_list.append(b)
  A_list.append(c)

N = int(input())
flag=True

for i in range(N):
  num = int(input())

  tmp = my_index(A_list, num)
  if tmp != False or tmp == 0:
    A_list[tmp] = -1
  
  if ((A_list[0] == A_list[3]) and (A_list[0] == A_list[6]) and (A_list[3] == A_list[6])) or ((A_list[1] == A_list[4]) and (A_list[1] == A_list[7]) and (A_list[4] == A_list[7])) or ((A_list[2] == A_list[5]) and (A_list[2] == A_list[8]) and (A_list[5] == A_list[8])) or ((A_list[0] == A_list[4]) and (A_list[0] == A_list[8]) and (A_list[4] == A_list[8])) or ((A_list[2] == A_list[4]) and (A_list[2] == A_list[6]) and (A_list[4] == A_list[6])) or ((A_list[0] == A_list[1]) and (A_list[0] == A_list[2]) and (A_list[1] == A_list[2])) or ((A_list[3] == A_list[4]) and (A_list[3] == A_list[5]) and (A_list[4] == A_list[5])) or ((A_list[6] == A_list[7]) and (A_list[6] == A_list[8]) and (A_list[7] == A_list[8])):
    print("Yes")
    flag=False
    break

if flag:
  print("No")


### FIXED CODE ###

N, M = map(int, input().split())
num_list = [0]*N

flag=True

for _ in range(M):
  s, c = map(int, input().split())

  if (s == 1 and c == 0 and N != 1):
    print(-1)
    flag=False
    break

  if (num_list[s-1] == 0):
    num_list[s-1] = c
  else:
    if num_list[s-1] != c:
      print(-1)
      flag=False
      break

if flag:
  if num_list[0] == 0 and N != 1:
    num_list[0] = 1

  ans = ""
  for i in num_list:
    ans += str(i)

  print(ans)
N=int(input())
S=input()
if N%2==1:
  print("No")
else:
  flag=0
  for i in range(len(S)):
    if S[i]!=S[i+(len(S)/2)]:
      flag=1
      break
  if flag==0:
    print("Yes")
  else::
    print("No")

### FIXED CODE ###

n=int(input())
s=input()
if n%2==1:
  print("No")
else:
  for i in range(n//2):
    if s[i]!=s[i+(n//2)]:
      print("No")
      break
  else:
    print("Yes")
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

Bsize = 700

def Mo_argsort(LR):
    L = LR[:, 0]
    R = LR[:, 1]
    key1 = L // Bsize
    key2 = np.where(key1 & 1, -R, R)
    key = (key1 << 32) + key2
    return np.argsort(key)

def main(A, LR):
    N = len(A)
    Q = len(LR)
    ind = Mo_argsort(LR)
    count = np.zeros(N + 1, np.int32)
    ans = 0

    def add(x):
        nonlocal ans
        if not count[x]:
            ans += 1
        count[x] += 1

    def rem(x):
        nonlocal ans
        count[x] -= 1
        if not count[x]:
            ans -= 1

    answers = np.empty(Q, np.int32)
    nl, nr = 0, 0
    for i in ind:
        pass
    return answers

if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i4 = numba.int32
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    Mo_argsort = cc_export(Mo_argsort, (i8[:,:],))
    main = cc_export(main, (i8[:], i8[:, :]))
    cc.compile()

from my_module import main

N, Q = map(int, readline().split())
A = np.array(readline().split(), np.int64)
LR = np.array(read().split(), np.int64).reshape(Q, 2)

ans = main(A, LR)
print('\n'.join(map(str, ans.tolist())))


### FIXED CODE ###

import sys
import numpy as np
import numba
from numba import njit
from numba.types import Omitted
i4 = numba.int32
i8 = numba.int64

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

Bsize = 700

@njit((i8[:, :], ), cache=True)
def Mo_argsort(LR):
    L = LR[:, 0]
    R = LR[:, 1]
    key1 = L // Bsize
    key2 = np.where(key1 & 1, -R, R)
    key = (key1 << 32) + key2
    return np.argsort(key)

@njit((i8[:], i8[:, :]), cache=True)
def main(A, LR):
    N = len(A)
    Q = len(LR)
    ind = Mo_argsort(LR)
    count = np.zeros(N + 1, np.int64)
    ans = 0
    

    def add(x):
        nonlocal ans
        if not count[x]:
            ans += 1
        count[x] += 1

    def rem(x):
        nonlocal ans
        count[x] -= 1
        if not count[x]:
            ans -= 1

    answers = np.empty(Q, np.int64)
    nl, nr = 0, 0
    for i in ind:
        l, r = LR[i]
        l -= 1
        # 区間 [l, r) に対する計算
        while nl > l:
            nl -= 1
            add(A[nl])
        while nr < r:
            add(A[nr])
            nr += 1
        while nl < l:
            rem(A[nl])
            nl += 1
        while nr > r:
            nr -= 1
            rem(A[nr])
        #  答を求めて ans[i] に格納する
        answers[i] = ans
    return answers

N, Q = map(int, readline().split())
A = np.array(readline().split(), np.int64)
LR = np.array(read().split(), np.int64).reshape(Q,2)

ans = main(A, LR)
print('\n'.join(map(str, ans.tolist())))
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	a,b = max(a,b), min(a,b)
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

### FIXED CODE ###

N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
s=input()
s[3]='8'
print(s)

### FIXED CODE ###



"""
2017/01/31

2018/01/31

"""

date=input()

dates=date.split('/')
dates[0]='2018'
print('/'.join(dates))
20
xxzaffeeeeddfkkkkllq

### FIXED CODE ###

n=int(input())
d=list(input())
ans=1
for i in range(1,n):
    if d[i-1]!=d[i]:
        ans+=1
print(ans)
N,M=map(int,input().split())
AB=[[int(x) for x in input().split()] for i in range(N)]
AB.sort(key=lambda x: x[0])
out = 0
count = M
for i in range(M):
    if AB[i][1]<count+1:
        count-=AB[i][1]
        out+=AB[i][0]*AB[i][1]
    else:
        out+=count*AB[i][0]
        break
print(out)

### FIXED CODE ###

N,M=map(int,input().split())
AB=[[int(x) for x in input().split()] for i in range(N)]
AB.sort(key=lambda x: x[0])
out = 0
count = M
for i in range(N):
    if AB[i][1]<count+1:
        count-=AB[i][1]
        out+=AB[i][0]*AB[i][1]
    else:
        out+=count*AB[i][0]
        break
print(out)
A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) = (C + D) else 'Right')

### FIXED CODE ###

A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) == (C + D) else 'Right')
import numpy as np
from math import log
N = int(input())
if N % 2:
    print(0)
    quit()
print(((N // 2) // np.array([5**i for i in range(1, int(log(N // 2, 5)) + 1)], np.int64)).sum())


### FIXED CODE ###

N = int(input())
if N % 2 == 0:
    total = 0
    temp = (N // 2) // 5
    total += temp
    while temp:
        temp //= 5
        total += temp
    print(total)
else:
    print(0)