Harryxun/stf_run huggingface dataset:
n = int(input())
if n % 2 == 1:
  print(0)
else:
  first = 10
  count = 0
  if n >= first:
    while n >= first:
      count += n //first
      first = 5 *first
  
print(count)
  



  

### FIXED CODE ###

n = int(input())
if n % 2 == 1:
  print(0)
else:
  first = 10
  count = 0
  if n >= first:
    while n >= first:
      count += n //first
      first = 5 *first
  
  print(count)
s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
if a*b*c == 1:
    print('Yse')
else;
    print('No')

### FIXED CODE ###

s = sorted(input())
if s[0] == 'a' and s[1] == 'b' and s[2] == 'c':
    print('Yes')
else:
    print('No')
import warnings

for i in range(99999999):
	data = input()
	if(data == 0):
		break
	else:
		print "Case " + str(i) + ": " + str(data)

### FIXED CODE ###

import warnings


n = 0
i = 0
while (n == 0): 

	i = i + 1

	data = input()
	if(data == 0):
		break
	else:
		print "Case " + str(i) + ": " + str(data)
n=int(input())
a=[list(input()) for i in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)

### FIXED CODE ###

import math
import collections

n=int(input())
a=[list(input()) for i in range(n)]
b=[str(sorted(list(i))) for i in a]
count=list(collections.Counter(b).values())
count=[i for i in count if i>1]
print(int(sum([math.factorial(x)/(math.factorial(x-2)*2) for x in count])))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
M = [int(input()) for i in range(N)]
for m in range(M):
	if M[m] in A:
		A[M[m]] = 0
	elif M[m] in B:
		B[M[m]] = 0
	elif M[m] in C:
		C[M[m]] = 0
for t in range(3):
	if A[t] + B[t] + C[t] == 0:
		print('Yes')
		sys.exit()
if sum(A) == 0 or sum(B) == 0 or sum(C) ==0:
	print('Yes')
	sys.exit()
elif A[0] + B[1] + C[2] == 0:
	print('Yes')
	sys.exit()
elif A[2] + B[1] +C[0] == 0:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

import sys
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
M = [int(input()) for i in range(N)]
for m in range(len(M)):
	if M[m] in A:
		A[A.index(M[m])] = 0
	elif M[m] in B:
		B[B.index(M[m])] = 0
	elif M[m] in C:
		C[C.index(M[m])] = 0
for t in range(3):
	if A[t] + B[t] + C[t] == 0:
		print('Yes')
		sys.exit()
if sum(A) == 0 or sum(B) == 0 or sum(C) ==0:
	print('Yes')
	sys.exit()
elif A[0] + B[1] + C[2] == 0:
	print('Yes')
	sys.exit()
elif A[2] + B[1] +C[0] == 0:
	print('Yes')
else:
	print('No')
C1,C2 = input().split()
C1_reverse = C1[2] + C1[1] + C[0]
print('YES' if C1_reverse == C2 else 'NO')

### FIXED CODE ###

C1 = input()
C2 = input()
C1_r = C1[2] + C1[1] + C1[0]
print('YES' if C1_r == C2 else 'NO')
A, B = map(int, input().split())

def calc(x): #[0, x]
    if x == 0: return 0
    res = 0
    x += 1
    for i in range(64):
        length = 2**i
        cycle = 2**(i+1)
        num = (x // cycle) * length
        if (x % cycle) > length: num += x % cycle - length
        if num%2: res += 2**i
    return res

def calc2(x):
    res = 0
    for i in range(x+1): res ^= i
    return res

for i in range(100):
    a, b = calc(i), calc2(i)
    assert a == b ,f'i={i}, a={a}, b={b}'

ans = calc(B) ^ calc(A-1)
print(ans)


### FIXED CODE ###

A, B = map(int, input().split())

def calc(x): #[0, x]
    if x == 0: return 0
    res = 0
    x += 1
    for i in range(64):
        length = 2**i
        cycle = 2**(i+1)
        num = (x // cycle) * length
        if (x % cycle) > length: num += x % cycle - length
        if num%2: res += 2**i
    return res
'''
def calc2(x):
    res = 0
    for i in range(x+1): res ^= i
    return res

for i in range(100):
    a, b = calc(i), calc2(i)
    assert a == b ,f'i={i}, a={a}, b={b}'
'''

ans = calc(B) ^ calc(A-1)
print(ans)
(h, w) = map(int, input().split(" "))

a=[]
for i in range(h):
        aline[i] = input().split(" ")

print("#" * (w+2))

for i in range(h):
    print("#", end="")
    for j in range(w):
        print(aline[i][j], end="")
    print("#")

print("#" * (w+2))



### FIXED CODE ###

(h, w) = map(int, input().split(" "))

a=[]
for i in range(h):
        a.append(input())

print("#" * (w+2))

for i in range(h):
    print("#"+a[i]+"#")

print("#" * (w+2))
n = [int(i+1) for i in range(input())]

total = 0
for i in n:
  	if (n % 3 =! 0) and (n % 5 =! 0):
      	total += i
        
print(total)

### FIXED CODE ###

total = 0
for i in range(int(input())):
  if int((i+1) % 3) != 0:
    if int((i+1) % 5) != 0:
    	total += i+1
        
print(total)
a = []
i = 0

s = int(input())

a.append(s)

while True:
    if(a[i] % 2 == 0):
        ans = int(a[i] / 2)
        if ans in a:
            print(str(i + 2))
            break
       	a.append(ans)
    else:
        anss = int(a[i] * 3 + 1)
        if anss in a:
            print(str(i + 2))
            break
        a.append(anss)

    i += 1
    
print(a)

### FIXED CODE ###

AB, BC, CA = map(int, input().split())

a = int(AB * BC / 2)

print(str(a))
import math

cycles = []
for i in range(5):
    cycles.append(int(input()))


minimum_last_order_cycle = 9
for cycle in cycles:
    if cycle % 10 <= minimum_last_order_cycle % 10 and cycle % 10 > 0:
        minimum_last_order_cycle = cycle

cycles.remove(minimum_last_order_cycle)

time = 0
for cycle in cycles:
    time += math.ceil(cycle / 10) * 10

time += minimum_last_order_cycle

print(time)


### FIXED CODE ###

import math

cycles = []
for i in range(5):
    cycles.append(int(input()))

minimum_last_order_cycle = None
for cycle in cycles:
    if minimum_last_order_cycle is None and cycle % 10 > 0:
        minimum_last_order_cycle = cycle
    elif minimum_last_order_cycle is not None and cycle % 10 < minimum_last_order_cycle % 10 and cycle % 10 > 0:
        minimum_last_order_cycle = cycle

if minimum_last_order_cycle is None:
    minimum_last_order_cycle = cycles[0]

cycles.remove(minimum_last_order_cycle)

time = 0
for cycle in cycles:
    time += math.ceil(cycle / 10) * 10

time += minimum_last_order_cycle

print(time)
class ABC109Solver():
    def __init__(self):
        self.a = int()
        self.b = int()

    def input(self, a, b):
        self.a = a
        self.b = b

    def solve(self):
        # return 'Yes'
        # return 'No' if self.b%2 == 0 else 'Yes'
        return 'No' if self.a%2 == 0 or self.b%2 == 0 else 'Yes'
      
a = input()
b = input()
solver = ABC109Solver()
solver.input(a, b)
print( solver.solve() )

### FIXED CODE ###

class ABC109Solver():
    def __init__(self):
        self.a = int()
        self.b = int()
    def input(self, a, b):
        self.a = a
        self.b = b
    def solve(self):
        # return 'Yes'
        # return 'No' if self.b%2 == 0 else 'Yes'
        return 'No' if self.a%2 == 0 or self.b%2 == 0 else 'Yes'

vals = input().split(' ')
a, b = int(vals[0]), int(vals[1])
solver = ABC109Solver()
solver.input(a,b)
 
print( solver.solve() )
"Yes" if (N == M) else "No"

### FIXED CODE ###

N, M = input().split()
print("Yes" if N == M else "No")
N, Q = map(int, input().split())
edge = [[] for _ in range(N)]
for i in range(N-1):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

ans = [0]*N
for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

from collections import deque

visited = [False]*N
d = deque([0])
while len(d)>0:
    v = d.popleft()
    visited[v]= True
    for u in edge[v]:
        if visited[u]==False:
            ans[u] += ans[v]
            visited[u]=True
            d.append(u)

print(*ans, sep=' ')

### FIXED CODE ###

a = int(input())
s = input()
if a>=3200:
  print(s)
else:
  print('red')
a = int(input())
b = int(input())

print((a - 1) * (b - 1))

### FIXED CODE ###

a, b = map(int, input().split())
 
print((a - 1) * (b - 1))
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
dp = [-1] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    if a:
        if a[-1] == aa - 1:
            print(0)
            exit()
    a.append(aa)
    dp[aa] = 0
mod = 10 ** 9 + 7

dp[0] = 1
if a[0] != 1:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

### FIXED CODE ###

n, m = map(int, input().split())
dp = [0] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = -1
    a.append(aa)
for i in range(m - 1):
    if a[i] + 1 == a[i + 1]:
        print(0)
        exit()
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])
n = int(input())
s = 0
for i in range(N+1):
    s += i
print(s)

### FIXED CODE ###

N = int(input())
s = 0
for i in range(N+1):
    s += i
print(s)
X, Y = map(int,input().split)
ans = "No"
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = "Yes"
print(ans)

### FIXED CODE ###

X, Y = list(map(int, input().split()))
ans = "No"
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = "Yes"
print(ans)
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    BC = []
    for i in range(M):
        bc = list(map(int, input().split()))
        BC.append(bc)

    BC.sort(key=lambda x: x[1], reverse=True)
    B = []
    for b, c in BC:
        B = B + [c] * b
        if len(B) > N:
            break

    A.sort(reverse=True)
    
    i = 0
    j = 0
    r = [None] * N
    while i + j < N:
        if A[i] > B[j]:
            r[i+j] = A[i]
            i += 1
        else:
            r[i+j] = B[j]
            j += 1

    # print(r)
    ans = sum(r)
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from operator import itemgetter

def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    BC = []
    for i in range(M):
        bc = list(map(int, input().split()))
        BC.append(bc)

    BC.sort(key=itemgetter(1), reverse=True)
    # B = []
    # for b, c in BC:
    #     B = B + [c] * b
    #     if len(B) > N:
    #         break

    A.sort(reverse=True)
    
    i = 0
    j = 0
    r = []

    cnt = 0
    while len(r) != N:
        # print(i, j)
        if j > M - 1:
            r.append(A[i])
            i += 1
            continue

        b, c = BC[j]
        if A[i] >= c:
            r.append(A[i])
            i += 1
        else:
            r.append(c)
            cnt += 1
            if cnt == b:
                j += 1
                cnt = 0

    # print(r)
    ans = sum(r)
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())

total = 1
for i in range(n):
  x = int(input())
  total = total*x

if total <= 1000000000000000000:
  print(total)
else:
  print(-1)

### FIXED CODE ###

n = int(input())
 
List = [int(i) for i in input().split()]
lst = sorted(List, reverse=True)
if lst[-1] == 0:
  print(0)
  exit()
total = 1
for i in lst:
  total = total*i
  if total > 1000000000000000000:
    print(-1)
    exit()
print(total)
s = input()
if a[5]+a[6] > 4:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

s = input()
if s <= "2019/04/30":
  print("Heisei")
else:
  print("TBD")
l,r,d = map(int,input())
c = 0
for i in range(l,r+1):
  if i%d == 0:
    c += 1
print(c)

### FIXED CODE ###

l,r,d = map(int,input().split())
c = 0
for i in range(l,r+1):
  if i%d == 0:
    c += 1
print(c)
N = int(input())
p = list(map(int, input().split()))
q = p.copy()
cnt = 0
for n in range(N):
    if p[n] != q[n]:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a, b = map(int, input().split())
if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))
S = input()
 
arr = [0 if s == "W" else 1 for s in S]
 
state = [arr[i] * i for i in range(len(S))]
final_state = [sorted(arr)[i] * i for i in range(len(S))]
 
print(final_state - state)
S = input()

arr = [0 if s == "W" else 1 for s in S]

state = sum([arr[i] * i for i in range(len(S))])
final_state = sum([sorted(arr)[i] * i for i in range(len(S))])

print(final_state - state)

### FIXED CODE ###

S = input()
 
arr = [0 if s == "W" else 1 for s in S]
sorted_arr = sorted(arr)
  
state = sum([arr[i] * i for i in range(len(S))])
final_state = sum([sorted_arr[i] * i for i in range(len(S))])
 
print(final_state - state)
s = int(input())
w = int(input())
if s <= w:
  print('unsafe')
else:
  print('safe')


### FIXED CODE ###

a = input().split()
s = int(a[0])
w = int(a[1])
if s <= w:
  print('unsafe')
else:
  print('safe')
S=list(int(i) for i in input().split())
for x in range(len(S)+1):
  if S[x]==S[x+1]:
    print('Bad')
    break 
else:
  print('Good')


### FIXED CODE ###

S=list(int(i) for i in input())
for i in range(len(S)-1):
  if S[i]==S[i+1]:
    print('Bad')
    break
else:
  print('Good')
import sys
import heapq
input = sys.stdin.readline

priority_que = []
N, K = map(int, input().split())
A = sorted(map(int, input().split()))
F = sorted(map(int, input().split()))[::-1]
if sum(A) <= K:
    print(0)
    exit()
hpop = heapq.heappushpop
hpush = heapq.heappush
score = [float('inf')] * K
for i, a in enumerate(A):
    f = F[i]
    key = f*a
    while key >= 0:
        # print(key)
        if len(priority_que) > K:
            if key <= priority_que[0]:
                break
            hpop(priority_que, key)
        else:
            hpush(priority_que, key)
        key -= f

# print(priority_que)
print(heapq.heappop(priority_que))


### FIXED CODE ###

import sys
import heapq


def can_eat_with_score(key):
    now_K = K
    for i, now_score in enumerate(score):
        if key < now_score:
            now_K -= (now_score-key+F[i]-1) // F[i]
            if now_K < 0:
                return False
    return True


input = sys.stdin.readline

priority_que = []
N, K = map(int, input().split())
A = sorted(map(int, input().strip().split()))
F = sorted(map(int, input().strip().split()))[::-1]
score = [A[i]*F[i] for i in range(N)]
if sum(A) <= K:
    print("0")
    exit()


left = -1
right = max(score)
while right - left > 1:
    mid = (left+right) // 2
    can_eat = can_eat_with_score(mid)
    # print(mid, can_eat)
    if can_eat:
        right = mid
    else:
        left = mid
print(left+1)
#!/usr/bin/env python
n=int(input())
lst=list(map(int,input().split()))

for i in range(0,n):
    if lst[i]%2==0:
        if lst[i]%3==0 or lst[i]%5==0:
            x=1
            
        else: x=0
if x==1:print("APPROVED")
else: print("DENIED")

### FIXED CODE ###

s = set(map(int, input().split()))
if len(s) == 2:
    print("Yes")
else:
    print("No")
n, x = map(int, input().split())
l = int(input()).split()

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

### FIXED CODE ###

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

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x:
    count+=1
print(count + 1)
"""
a = "kanji"
for i in a:
  print(i)
"""

s = raw_input()
print(s)

ch_lst = "abcdefghijklmnopqrstqvwxyz"
#ch_lst = [chr(i) for i in range(ord('a'), ord('z')+1)]
print(ch_lst)

match = 0
for j in ch_lst:
  ch = s.find(j)
  if ch != -1:
    #print(ch)
  else:
    match = 1
    break

if match == 0:
  print("none")
elif match == 1:
  print(j)

### FIXED CODE ###

s = raw_input()
#print(s)

ch_lst = "abcdefghijklmnopqrstqvwxyz"
#ch_lst = [chr(i) for i in range(ord('a'), ord('z')+1)]
#print(ch_lst)

match = 0
for j in ch_lst:
  ch = s.find(j)
  if ch != -1:
    continue
  else:
    match = 1
    break

if match == 0:
  print("None")
elif match == 1:
  print(j)
raise TypeError

### FIXED CODE ###

N=int(input())
xyh=[list(map(int,input().split(' '))) for i in range(N)]
for i in range(101):
    for j in range(101):
        H_0=set([h+abs(x-i)+abs(y-j) for x,y,h in xyh])
        H_1=set([h+abs(x-i)+abs(y-j) for x,y,h in xyh if h!=0])
        if len(H_0)==1:
            print(i,j,max(H_0))
            exit()
        if len(H_1)==1:
            cx,cy,H=i,j,max(H_1)
print(cx,cy,H)
n=int(input())
a=list(map(int,input().split()))
a.reverse(key=int)
Ali=0
Bob=0
for i in range(n):
	if i%2==0:
       Ali+=a[i]
	else:
       Bob+=a[i]
ans(Ali-Bob)
       

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
aa=sorted(a,key=int,reverse=True)
Ali=0
Bob=0
for i in range(n):
	if i%2==0:
	    Ali+=aa[i]
	else:
	    Bob+=aa[i]
print(Ali-Bob)
N,Q = map(int, input().split())
S = input()
SUM = [0] * (N + 1)
L = [0]*Q
R = [0]*Q


for i in range(N):
    if S[i] == "A" and S[i+1] == "C":
        SUM[i+1] = SUM[i] + 1
    else:
        SUM[i+1] = SUM[i]

for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))
    #indexを0からにする
    print(SUM[R[i]-1] - SUM[L[i]-1])

### FIXED CODE ###

N,Q = map(int, input().split())
S = input()
SUM = [0] * (N + 1)
L = [0]*Q
R = [0]*Q


for i in range(N-1):
    if S[i] == "A" and S[i+1] == "C":
        SUM[i+1] = SUM[i] + 1
    else:
        SUM[i+1] = SUM[i]

for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))
    #indexを0からにする
    print(SUM[R[i]-1] - SUM[L[i]-1])
n = int(input())
s = list(input())

i = 0
while i<len(s)-1:
  if s[i] == s[i+1]:
    del s[i]
  else:
    i += 1
print(len(s))

### FIXED CODE ###

A,B = map(int,input().split())

num = A - 2*B
if num >= 0:
	print(num)
else:
	print("0")
n = int(input())

li = []

for _ in range(n):
    x, y = list(map(int, input().split(" ")))
    li.append([x, y])

li.sort()

def cal(li):
    n = len(li)
    Route = []
    for s in range(n-1):
        x1, y1 = li[s]
        route = {}
        for i in range(s+1,n):
            xi, yi = li[i]

            if xi != x1:
                diff = (yi - y1)/(xi - x1)
            else:
                diff = 10e10

            if diff in route.keys():
                route[diff].append([xi, yi])
            else:
                route[diff] = [[x1,y1], [xi, yi]]

        Route.extend(route.values())
    return Route

cost = 0
route = cal(li)

def check(A,B):
    for a in A:
        if a not in B:
            return False
    
    return True

def max_cal(route, li):
    n = len(li)
    l_max = 0
    max_li = []
    for r in route:
        if check(r,li):
            l = len(r)
            if l > l_max:
                 max_li = r
                 l_max = l
    return l_max, max_li

while True:
    l, cand = max_cal(route, li)
    if l == 0:
        cost += len(li)-1
        break
    else:
        route.remove(cand)
        for c in cand:
            li.remove(c)
        n -= l
        cost += 1

print(cost)




### FIXED CODE ###

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

if k == 1:
  print(0)
else:
  print(n - k)
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))

print(t_diff_list.index(min(t_val_list)))


### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))
 
print(t_diff_list.index(min(t_diff_list)) + 1)
lst = list(map(lst = list(map(int,input().split()))
if sum(lst)>=22:
    print("bust")
else:
    print("win")int,input().split()))


### FIXED CODE ###

lst = list(map(int,input().split()))
if sum(lst)>=22:
    print("bust")
else:
    print("win")
a,b = int (input ())
if a+b == 15:
  print ('+')
elif a*b == 15:
  print ('*')
else:
  print ('x')

### FIXED CODE ###

a,b = map (int, input ().split ())
if a+b == 15:
  print ('+')
elif a*b == 15:
  print ('*')
else:
  print ('x')
s = 40020
m = s / 60
h = m / 60

print(h:m:s)

### FIXED CODE ###

a = int(input())
h = int(a/3600)
m=int((a%3600)/60)
s=int((a%3600)%60)

print(h,m,s,sep=":")
a,b,c,d = map(int,input().split())
from fractions import gcd
cd_gcd = gcd(c,d)
lcm= c*d // ab_gcd
divs = lcm//c + lcm//d - 1

ans = 0
ans += int((b-a)/lcm)*divs
for i in range(a % lcm, b%lcm+lcm+1):
  if not i % c or not i % d:
    ans += 1
print(b-a - ans)
    

### FIXED CODE ###

a,b,c,d = map(int,input().split())
a -= 1
import fractions

lcm = c*d//fractions.gcd(c,d)
ansa = a - a//c - a//d + a//lcm
ansb = b - b//c - b//d + b//lcm

print(ansb-ansa)
n = int(input())
t = []
ans = 1
for i in range(n):
    t.append(int(input()))
def gcd(a,b):
    while b>0:
        a,b = b, a%b
    return a
def lcm(a,b):
    return a*b/gcd(a,b)

for i in range(n):
    ans = lcm(ans,t[i])

print(int(ans))

### FIXED CODE ###

n = int(input())
t = []
ans = 1
for i in range(n):
    t.append(int(input()))
def gcd(a,b):
    while b>0:
        a,b = b, a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

for i in range(n):
    ans = lcm(ans,t[i])

print(ans)
def main():
    from sys import stdin
    input = stdin.readline
    import numpy as np
    import scipy.sparse as sp

    n, m, s, t = map(int, input().split())
    uvab = np.array([list(map(int, input().split())) for _ in [0]*m])

    data = np.append(uvab[:, 2], uvab[:, 2])
    row = np.append(uvab[:, 0], uvab[:, 1]) - 1
    col = np.append(uvab[:, 1], uvab[:, 0]) - 1

    matrix = sp.csr_matrix(
        (data, (row, col)), shape=(n, n), dtype=np.int32)
    yen = sp.csgraph.shortest_path(matrix, indices=s-1)

    data = np.append(uvab[:, 3], uvab[:, 3])
    matrix = sp.csr_matrix(
        (data, (row, col)), shape=(n, n), dtype=np.int32)
    snk = sp.csgraph.shortest_path(matrix, indices=t-1)

    cost = yen+snk
    m = cost[-1]
    for i in range(n-1, -1, -1):
        m = min(cost[i], m)
        cost[i] = m

    cost = 10**15-cost

    for i in cost:
        print(int(i))


main()

### FIXED CODE ###

n,m,s,t=map(int,input().split())
uvab=[list(map(int,input().split())) for _ in [0]*m]
g_yen=[[] for _ in [0]*n]
[g_yen[u-1].append([v-1,a]) for u,v,a,b in uvab]
[g_yen[v-1].append([u-1,a]) for u,v,a,b in uvab]

g_snk=[[] for _ in [0]*n]
[g_snk[u-1].append([v-1,b]) for u,v,a,b in uvab]
[g_snk[v-1].append([u-1,b]) for u,v,a,b in uvab]

import heapq
def dijkstra(g,start):
    inf=10**15
    dist=[inf for _ in [0]*n]
    h=[(0,start)]
    heapq.heapify(h)
    while h:
        d,i=heapq.heappop(h)
        if dist[i]==inf:
            dist[i]=d
            for x,y in g[i]:
                heapq.heappush(h,(d+y,x))
    return dist

yen=dijkstra(g_yen,s-1)
snk=dijkstra(g_snk,t-1)

cost=[yen[i]+snk[i] for i in range(n)]
m=cost[-1]
for i in range(n-1,-1,-1):
    m=min(m,cost[i])
    cost[i]=m
    
for i in cost:
    print(10**15-i)
a,b=map(int,input(),split())
x=a*b
y=2*(a+b)
print(x,y)


### FIXED CODE ###

a,b=map(int,input().split())
x=a*b
y=2*(a+b)
print(x,y)
a, b = map(int, input().split())

if a > b:
  print("Alice")
elif a = b:
  print("Draw")
else:
  print("Bob")

### FIXED CODE ###

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

if a==1 or b==1:
  print("Alice" if a<b
       else "Draw" if a==b
       else "Bob")
else:
  print("Alice" if a>b
       else "Draw" if a==b
       else "Bob")
H, W = [int(_) for _ in input().split()]
S = [input() for _ in range(H)]

def solve(H, W, S):
    S = [s + "." for s in S] + ["." * (W + 1)]
    for y in range(H):
        for x in range(H):
            if (S[y][x] == "#" and
                S[y][x + 1] == "." and S[y][x - 1] == "." and
                S[y + 1][x] == "." and S[y - 1][x] == "."
            ):
                return False
    return True

if solve(H, W, S):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

H, W = [int(_) for _ in input().split()]
S = [input() for _ in range(H)]

def solve(H, W, S):
    S = [s + "." for s in S] + ["." * (W + 1)]
    for y in range(H):
        for x in range(W):
            if (S[y][x] == "#" and
                S[y][x + 1] == "." and S[y][x - 1] == "." and
                S[y + 1][x] == "." and S[y - 1][x] == "."
            ):
                return False
    return True

if solve(H, W, S):
    print("Yes")
else:
    print("No")
from sys import stdin

N, M = map(int, stdin.readline().split())
A = list(map(int, stdin.readline().split()))
for _ in range(M):
    B, C = map(int, stdin.readline().split())
    A.extend([C]*B)
A.sort(reverse=True)
ans = 0
for i in range(N):
    ans += A[i]

print(ans)


### FIXED CODE ###

from sys import stdin

A, B = map(int, stdin.readline().split())
if A >= 13:
  print(B)
elif 12 >- A and A >= 6:
  print(B // 2)
else:
  print(0)