Harryxun/stf_run huggingface dataset:
K = input()
S = input()
count = 0

for x in range(K):
    for y in range(K):
        z = S - x - y
        if 0 <= z and z <= K:
            count += 1

print(count)


### FIXED CODE ###

K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)
from fractions import gcd
from functools import reduce

def gcd_lcm(lists):
    LCM = lists[0]
    for i in range(1,len(lists)):
        if i == len(lists) - 1:
            GCD = gcd(LCM,lists[i])
        LCM = (LCM * lists[i]) // gcd(LCM,lists[i])
    return GCD,LCM

def main():
    N = int(input())
    A = sorted([int(i) for i in input().split()])
    MOD = 10**9+7

    GCD,LCM = gcd_lcm(A)
    ans = 0
    if GCD != 1 and LCM == A[-1]:
        for i in range(N):
            ans = (ans + A[-1] // A[i]) % MOD
    else:
        for i in range(N):
            ans = (ans + LCM // A[i]) % MOD

    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
from fractions import gcd
from functools import reduce

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]
# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

def gcd_list(numbers):
    return reduce(gcd, numbers)
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def main():
    N = int(input())
    A = sorted([int(i) for i in input().split()])
    MOD = 10**9+7

    GCD = gcd_list(A)
    LCM = lcm_list(A) % MOD
    ans = 0
    if GCD != 1 and LCM == A[-1]:
        for i in range(N):
            ans = (ans + A[-1] * mod_inv(A[i],MOD)) % MOD
    else:
        for i in range(N):
            ans = (ans + LCM * mod_inv(A[i],MOD)) % MOD

    print(ans)

if __name__ == "__main__":
    main()
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())
shop=[]
for i in range(n):
    shop.append(map(int,input().split()))
shop_sorted=sorted(shop,key=lambda x :x[0])
ans=0
cnt=0
for a,b in shop_sorted:
    tmp=cnt
    cnt=min(m,cnt+b)
    ans+=a*(cnt-tmp)
    if cnt==m:
        break
print(ans)

### FIXED CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(n)]
AB=sorted(AB,key=lambda x:x[0])
cnt=0
ans=0
for a,b in AB:
    tmp=cnt
    cnt=min(m,cnt+b)
    ans+=a*(cnt-tmp)
    if cnt==m:
        break
print(ans)
n=str(input())
sum=0
for i in n:
	sum+=int(i)
if sum%9=0:
	print('Yes')
else:
	print("No")

### FIXED CODE ###

n=str(input())
sum=0
for i in n:
	sum+=int(i)
if sum%9==0:
	print('Yes')
else:
	print("No")
n, m = map(int, input().split())
h = list(map(int, input().split()))
g = [[] for _ in range(n)]
t = [-1 for _ in range(n)]

def dfs(i):
    if t[i] != -1:
        return
    else:
        t[i] = 1
    for j in g[i]:
        if h[j] >= h[i]:
            t[i] = 0
        dfs(j)
    
for i in range(m):
    a, b = map(int, input().split())
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)

dfs(0)
ans = n
for i in t:
    if i == 0:
        ans -= 1
print(ans)

### FIXED CODE ###

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

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if h[a] > h[b]:
        t[b] = 0
    elif h[a] == h[b]:
        t[a] = 0
        t[b] = 0
    else:
        t[a] = 0
ans = 0
for i in t:
    if i==1:
        ans += 1
print(ans)
n = int(input())

power = 1
for i in range(n):
    power = power + (i+1)%1000000007
    power %= %1000000007

print(power)

### FIXED CODE ###

n = int(input())

power = 1
for i in range(n):
    power = power * (i+1)%1000000007
    power %= 1000000007

print(power)
n=int(input())
dp=[10**5]*n
dp[0]=0
for i in range(n+1):
    pow=1
    while pow<=n:
        dp[i]=min(dp[i],dp[i-pow]+1)
        pow*=6
    pow=1
    while pow<=n:
        dp[i]=min(dp[i],dp[i-pow]+1)
        pow*=9
print(dp[n+1])


### FIXED CODE ###

n=int(input())
dp=[10**5]*(n+1)
dp[0]=0
for i in range(n+1):
    pow=1
    while pow<=n:
        dp[i]=min(dp[i],dp[i-pow]+1)
        pow*=6
    pow=1
    while pow<=n:
        dp[i]=min(dp[i],dp[i-pow]+1)
        pow*=9
print(dp[n])
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict
import bisect

n, q = LI()
ds = []
stx = []
ans = [-1 for i in range(q)]
for i in range(n):
    s, t, x = LI()
    stx.append((s, t, x))
for i in range(q):
    d = SI()
    ds.append(d)
# stx = sorted(stx, key=lambda x: x[2])
for s, t, x in stx:
    sx = s - x
    tx = t - x
    i1 = bisect.bisect_left(ds, sx)
    i2 = bisect.bisect_left(ds, tx)
    for i in range(i1, i2):
        if ans[i] == -1 or ans[i] > x:
            ans[i] = x
for i in ans:
    print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

a, i = LI()
print(int((a * 3 + i) / 2))
import collections
n,m = map(int, raw_input().split(' '))
matrix = [list(raw_input()) for _ in range(n)]
dpleft = [[0 for j in range(m)] for i in range(n)]
dpright = [[0 for j in range(m)] for i in range(n)]
dpup = [[0 for j in range(m)] for i in range(n)]
dpdown = [[0 for j in range(m)] for i in range(n)]

for i in range(n):
	cumul = 0
	for j in range(m):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpleft[i][j] = cumul
			cumul +=1

	cumul = 0
	for j in range(m-1,-1,-1):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpright[i][j] = cumul
			cumul +=1

for j in range(m):
	cumul = 0
	for i in range(n):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpup[i][j] = cumul
			cumul +=1

	cumul = 0
	for i in range(n-1,-1,-1):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpdown[i][j] = cumul
			cumul +=1
r = 0
for i in range(len(matrix)):
	for j in range(len(matrix)):
		if matrix[i][j] != '#':
			r = max(r, 1 + dpleft[i][j] + dpright[i][j] + dpdown[i][j] + dpup[i][j])
print r

### FIXED CODE ###

import collections
n,m = map(int, raw_input().split(' '))
matrix = [list(raw_input()) for _ in range(n)]
dpleft = [[0 for j in range(m)] for i in range(n)]
dpright = [[0 for j in range(m)] for i in range(n)]
dpup = [[0 for j in range(m)] for i in range(n)]
dpdown = [[0 for j in range(m)] for i in range(n)]

for i in range(n):
	cumul = 0
	for j in range(m):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpleft[i][j] = cumul
			cumul +=1

	cumul = 0
	for j in range(m-1,-1,-1):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpright[i][j] = cumul
			cumul +=1

for j in range(m):
	cumul = 0
	for i in range(n):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpup[i][j] = cumul
			cumul +=1

	cumul = 0
	for i in range(n-1,-1,-1):
		if matrix[i][j] == '#':
			cumul = 0
		else:
			dpdown[i][j] = cumul
			cumul +=1
r = 0
for i in range(len(matrix)):
	for j in range(len(matrix[0])):
		if matrix[i][j] != '#':
			r = max(r, 1 + dpleft[i][j] + dpright[i][j] + dpdown[i][j] + dpup[i][j])

print r
import sys

lines = sys.stdin.readlines()
S = lines[0]

lst = ['SUN','MON','TUE','WED','THU','FRI','SAT']

num = lst.index(S)
print(7 - num)

### FIXED CODE ###

import sys

S = input()

lst = ['SUN','MON','TUE','WED','THU','FRI','SAT']

num = lst.index(S)
print(7 - num)
X, N = map(int,input().split())
P = list(map(int,input().split()))
if N==0:
    print(X)
else:
    Q = [i+1 for i in range(100)]
    for pi in P:
        Q.remove(pi)
    Q1 = [abs(qi - X) for qi in Q]
    print(Q[Q1.index(min(Q1))])

### FIXED CODE ###

X, N = map(int,input().split())
if N==0:
    print(X)
else:
    P = list(map(int,input().split()))
    P.sort()
    Q = [i-1 for i in range(-10,111)]
    for a in P:
        Q.remove(a)
    Q1 = [abs(b - X) for b in Q]
    print(Q[Q1.index(min(Q1))])
T = input()
lis = list(T)
n = lis.count("?")
 
temp = [i for i, x in enumerate(lis) if x == '?']
 
t = 0
for i, e in enumerate(temp):
    if 1 == e-t  and lis[e - 2] == "D":
        lis[e-1] = "P"
        lis[e] = "D"
    if e == 0:
        lis[e] = "P"
    if e <= len(lis) - 1:
        if lis[e + 1] == "D":
            lis[e] = "P"
    if lis[e - 1] == "P":
        lis[e] = "D"
 
    t = e
    LIS = ''.join(lis)
print(LIS)

### FIXED CODE ###

T = input()
print(T.replace("?","D"))
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

typedef char Board[10];
Board ini_board, board;
const Board target = "123456780";

Board *history;
int nhistories=0;

typedef enum { U, D, L, R } Direction;

typedef struct {
  int pos;
  Direction dir;
} Motion;

int minstep = 50;

const Motion candidate[9][5] =
  {{{1,L},{3,U},{-1}}, {{0,R},{2,L},{4,U},{-1}}, {{1,R},{5,U},{-1}},
   {{0,D},{4,L},{6,U},{-1}}, {{1,D},{5,L},{7,U},{3,R},{-1}},
   {{2,D},{8,U},{4,R},{-1}},
   {{3,D},{7,L},{-1}}, {{4,D},{8,L},{6,R},{-1}}, {{5,D},{7,R},{-1}}  };

int move(Motion m)
{
  if (m.pos==0 && board[0]=='1') return -1;
  if ((m.pos==1||m.pos==2) && board[0]=='1'&&board[1]=='2'&&board[2]=='3') return -1;

  switch (m.dir) {
  case U:
    if (m.pos<3) return -1;
    board[m.pos-3] = board[m.pos];
    break;
  case D:
    if (m.pos>5) return -1;
    board[m.pos+3] = board[m.pos];
    break;
  case L:
    if (m.pos%3==0) return -1;
    board[m.pos-1] = board[m.pos];
    break;
  case R:
    if (m.pos%3==2) return -1;
    board[m.pos+1] = board[m.pos];
    break;
  }
  board[m.pos] = '0';
  return m.pos;
}

void search_path(int step, int space)
{
  int i, j, s2;
  if (strcmp(board, "123456780")==0) {
    if (step==1) {
      printf("1\n");
      exit(0);
    }
    if (step<minstep) minstep=step;
  } else {
    if (step>=minstep) return;
    if (step>0 && strcmp(board, ini_board)==0) return;
    
    Board board_bak;
    strcpy(board_bak, board);
    int nhistories_bak=nhistories;

    for (i=0; candidate[space][i].pos>=0; i++) {
      if ((s2 = move(candidate[space][i]))<0) continue;
      for (j=0; j<nhistories; j++) {
	if (strcmp(board, history[j])==0) // 前と同じ配置になったので次の手を試す
	  break;
      }
      if (j==nhistories) {
	strcpy(history[nhistories++], board); 
	search_path(step+1, s2);
      }
      nhistories = nhistories_bak;
      strcpy(board, board_bak);
    }
  }
}

int main()
{
  fscanf(stdin, "%c %c %c\n", &board[0],&board[1],&board[2]);
  fscanf(stdin, "%c %c %c\n", &board[3],&board[4],&board[5]);
  fscanf(stdin, "%c %c %c\n", &board[6],&board[7],&board[8]);
  strcpy(ini_board, board);
  history = (Board*)malloc(sizeof(Board)*10000);
  search_path(0, strchr(board, '0')-board);
  printf("%d\n", minstep);
  return 0;
}



### FIXED CODE ###

import sys
import queue

N = 3

f = ''.join(sys.stdin.readline().split())
f += ''.join(sys.stdin.readline().split())
f += ''.join(sys.stdin.readline().split())

dd = [[-1, 0], [0, -1], [1, 0], [0, 1]]

Q = [[f,f.index('0'),0]]
V = { f: True }

while len(Q)>0:
    u = Q.pop(0)
    if u[0] == '123456780':  break
    sx, sy = u[1]//N, u[1]%N
    for dx, dy in dd:
        tx, ty = sx+dx, sy+dy
        if tx<0 or ty<0 or tx>=N or ty>=N: continue
        v = u[:]
        n1, n2 = u[1], tx*N+ty
        v[1] = n2
        if n1>n2: n1, n2 = n2, n1
        v[0] = v[0][0:n1]+v[0][n2]+v[0][n1+1:n2]+v[0][n1]+v[0][n2+1:]
        if not V.get(v[0], False):
            V[v[0]] = True
            v[2] += 1 # dir[r]                                                       
            Q.append(v)

print(u[2])
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
    exit()

l = l%2019
r = r%2019

if l >= r:
    print(0)
else:
    ans = float('inf')
    for left in range(l, r+1):
        for right in range(left+1, r+1):
            # ans = min(ans, (left*right)%2019)
            score = (left*right)%2019
            if score < ans:
                print(f'{left}, {right}: {score}')
                ans = score
    print(ans)

### FIXED CODE ###

l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
    exit()

l = l%2019
r = r%2019

if l >= r:
    print(0)
else:
    ans = float('inf')
    for left in range(l, r):
        for right in range(left+1, r+1):
            ans = min(ans, (left*right)%2019)
    print(ans)
from fractions import gcd

PO = "POSSIBLE"
IM = "IMPOSSIBLE"
ans = ""


N, K = map(int, input().split())		# 5 7
a = sorted(list(map(int, input().split())))	# 1 2 3 4 5 ...
#p(a)

if max(a)<K:
	print(IM)
	sys.exit()

if K in a:
	print(PO)
	sys.exit()

g=a[0]
for i in range(N):
	g = gcd(g,a[i])
	if K%g==0:
		ans=PO
		break
else:
	ans=IM


print(ans)


### FIXED CODE ###

import sys
from fractions import gcd

PO = "POSSIBLE"
IM = "IMPOSSIBLE"
ans = ""


N, K = map(int, input().split())		# 5 7
a = sorted(list(map(int, input().split())))	# 1 2 3 4 5 ...

if max(a)<K:
	print(IM)
	sys.exit()

if K in a:
	print(PO)
	sys.exit()

g=a[0]
for i in range(1,N):
	g = gcd(g,a[i])

if K%g==0:
	ans=PO
else:
	ans=IM


print(ans)
def main(): 
  MOD = 10e9+7
  n = int(input())
  a = sorted(map(int, input().split()))
  ans = 2**(n//2)%MOD
  if n%2:
    if a.pop(0)!=0:ans=0
  i = n%2 - 1
  for j in range(n//2):
    i += 2
    if a[j*2]!=i or a[j*2+1]!=i: ans=0
  print(int(ans))

if __name__=="__main__":main()

### FIXED CODE ###

n=int(input())
a=sorted(map(int, input().split()))
if n%2: b = [i if not(i%2) else i+1 for i in range(n)]
else: b = [i if i%2 else i+1 for i in range(n)]
if a==b:print((2**(n//2))%(10**9+7))
else: print(0)
for i in range(1,10):
  for j in range(1,10):
    print i,"*",j,"=",i*j

### FIXED CODE ###

for i in range(1,10):
 for j in range(1,10):
  print "%dx%d=%d" %(i,j,i*j)
def main():
    alpha=[int(intput()) for _in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')
                

### FIXED CODE ###

# -*- coding: utf-8 -*-


def main():
    alpha = [int(input()) for _ in range(5)]
    k = int(input())

    for a in alpha:
        for b in alpha:
            if abs(a - b) > k:
                print(':(')
                exit()

    print('Yay!')


if __name__ == '__main__':
    main()
q_input = input()

a, b = map(int, q_input.split(' '))

ans = int((10-1)/(a-1))

print(ans)


### FIXED CODE ###

# abc139_a.py
# https://atcoder.jp/contests/abc139/tasks/abc139_a

# A - Tenki /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# ある 3日間の天気予報が、長さ 3 の文字列 Sとして与えられます。
# Sの i (1≤i≤3) 文字目が S のとき、i日目の天気予報が晴れだったことを、C のときは曇りだったことを、R のときは雨だったことを意味します。
# また 3日間の実際の天気が、長さ 3 の文字列 Tとして与えられます。
# Tの i (1≤i≤3) 文字目が S のとき、i日目の実際の天気が晴れだったことを、C のときは曇りだったことを、R のときは雨だったことを意味します。
# 3日間で天気予報が的中した日が何日あるかを出力してください。

# 制約
#     Sおよび T は長さ 3の文字列である。
#     Sおよび Tは S, C, R のみからなる。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# S
# T

# 出力
# 3日間で天気予報が的中した日が何日あるかを出力せよ。

# 入力例 1
# CSS
# CSR

# 出力例 1
# 2

#     1日目の天気予報は曇り、実際の天気は曇りなので、この日の天気予報は的中している。
#     2日目の天気予報は晴れ、実際の天気は晴れなので、この日の天気予報は的中している。
#     3日目の天気予報は晴れ、実際の天気は雨なので、この日の天気予報は的中していない。

# 以上より、このケースでは 3日間で天気予報が的中した日が 2日あります。

# 入力例 2
# SSR
# SSR

# 出力例 2
# 3

# 入力例 3
# RRR
# SSS

# 出力例 3
# 0


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    T = lines[1]
    # N = int(lines[0])
    # X, A = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 0

    for s, t in zip(S, T):
        if s == t:
            result += 1

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['CSS', 'CSR']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['SSR', 'SSR']
        lines_export = [3]
    if pattern == 3:
        lines_input = ['RRR', 'SSS']
        lines_export = [0]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()
import math
N,A,B = map(int,input().split())
H = [int(input()) for _ in range(N)]


def enough(T):
    temp = 0
    ch = H[:]
    for h in ch:
        left = h - B*T
        if left > 0:
            temp += (left + A-B-1)//(A-B)
            #temp += math.ceil(left/(A-B))
            #print(temp)

    if temp > T:
        return False
    else:
        return True

#print(enough(2))
ok = 10**15
ng = 0

while ok - ng > 1:
    mid = (ok + ng)//2
    if enough(mid):
        ok = mid
    else:
        ng = mid
    #print(ok,ng)
print(ok)

### FIXED CODE ###

a,b = map(int,input().split())
if a+b >= 10:print("error")
else:print(a+b)
class Stack:
    MAX = 101

    def __init__(self):
        self.S = [None] * self.__class__.MAX
        self.top = 0

    def is_empty(self):
        return self.top == 0

    def is_full(self):
        return self.top >= self.__class__.MAX - 1

    def push(self, x):
        self.top += 1
        self.S[self.top] = x

    def pop(self):
        self.top -= 1
        return self.S[self.top + 1]


stack = Stack()
[stack.push(eval("".join(map(str, [stack.pop(), s, stack.pop()][::-1]))))
 if s in["+", "-", "*"]else stack.push(int(s)) for s in str(s) for s in [str(s) for s in input().split()]]
print(stack.pop())



### FIXED CODE ###

class Stack:
    MAX = 101

    def __init__(self):
        self.S = [None] * self.__class__.MAX
        self.top = 0

    def is_empty(self):
        return self.top == 0

    def is_full(self):
        return self.top >= self.__class__.MAX - 1

    def push(self, x):
        self.top += 1
        self.S[self.top] = x
        return x

    def pop(self):
        self.top -= 1
        return self.S[self.top + 1]


stack = Stack()
print([stack.push(eval("".join(map(str,[stack.pop(),s,stack.pop()][::-1]))))
       if s in["+","-","*"]else stack.push(int(s))for s in input().split()][-1])
n = int(input())
 
count = 0
 
if n%2 == 1:
    print(0)
else:
    for i im range(1,100):
        if n < 2*5**i:
            break
        else:
            count = count + (n)//(2*5**i)
            i += 1
        
print(count)

### FIXED CODE ###

n = int(input())
if n % 2:
  print(0)
  quit()
ans = 0
for i in range(1,36):
  ans += (n // (2 * 5 ** i))
print(ans)
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 = []
order = {}
x = 1
T = -1

while visited[x] == -1:
  x = a[x-1] #添字に合わせた
  points.append(x)
  visited[x] = len(points)
T = len(points) - visited[x]
s = visited[x]
if k < s:
  print(points[k])
else:
  k -= s
  mod = k % T
  print(points[s+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])
n=input()
Xs=list(map(int,input().split()))
Xs.sort()
a=Xs[0]
b=Xs[-1]
ans=inf
for p in range(a,b+1):
    m=0
    for x in Xs:
        m+=(x-p)**2
    if m<ans:
        ans=m
print(ans)


### FIXED CODE ###

n=int(input())
Xs=list(map(int,input().split()))
Xs.sort()
a=Xs[0]
b=Xs[-1]
ans=float("inf")
for p in range(a,b+1):
    m=0
    for x in Xs:
        m+=(x-p)**2
    if m<ans:
        ans=m
print(ans)
while True:
    s = input()
    if s == '_': 
        break

   m = int(input())
   for mi in range(m):
       h = int(input())
       s = s[m:] + s[:m]


   print(s)

### FIXED CODE ###

while True:
    s =input()
    if s =='-':   break
    loop=int(input())
    for i in range(loop):
        ch=int(input())
 
        s = s[ch:]+s[:ch]
    print(s)
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


### FIXED CODE ###

import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()
N = int(input())
An = list(map(int, input().split()))

for n in range(N):
    An[n] -= (n+1)

An.sort()

m = N-1
if (m % 2 == 0):
    cent = (An[m//2] + An[m//2 + 1]) // 2
else:
    cent = An[(m+1)//2]

ans = 0
for n in range(N):
    ans += abs(An[n] - cent)

print(ans)

### FIXED CODE ###

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

for n in range(N):
    An[n] -= (n+1)

An.sort()

if (N-1) % 2 != 0:
    m = N//2 - 1
else:
    m = (N-1)//2

bf = -sum(An[0:m+1:]) + (m+1)*An[m]
af = sum(An[m+1::]) - (N-m-1)*An[m]
ans = bf + af
print(ans)
N = int(input())

flag = 0
for i in range(10):
    if N % i == 0:
        a = N // i
        if a <= 9:
            print("Yes")
            flag = 1

if flag == 0:
    print("No")

### FIXED CODE ###

N = int(input())

flag = 0
for i in range(1, 10):
    if N % i == 0:
        a = N // i
        if a <= 9:
            flag = 1

if flag == 0:
    print("No")
else:
    print("Yes")
s, w = map(int, input().split())
if (s <= w):
  print('unsafe')
 else:
  print('safe')

### FIXED CODE ###

s, w = map(int, input().split())
if (s <= w):
  print('unsafe')
else:
  print('safe')