CodeEff/ECCO huggingface dataset:
# Original solution
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(200000000)


# my functions here!

#入力

def pin(type=int):
    return list(map(type,input().rstrip().split()))
from collections import Counter    
def resolve():
    N,=pin()
    A=list(pin())
    S=[sum(A[:i])for i in range(N+1)]
    
    s=list(Counter(S).values())
    ans=0
    for j in s:
            ans+=(j*(j-1))//2
    print(ans)
"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """6
1 3 -4 2 2 -2"""
        output = """3"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """7
1 -1 1 -1 1 -1 1"""
        output = """12"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """5
1 -2 3 -4 5"""
        output = """0"""
        self.assertIO(input, output)
if __name__=="__main__":resolve()

# Optimized solution
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(200000000)


# my functions here!

#入力

def pin(type=int):
    return list(map(type,input().rstrip().split()))
from collections import Counter
from itertools import accumulate as acm
def resolve():
    N,=pin()
    S=list(acm(pin()))
    S.insert(0,0)
    s=list(Counter(S).values())
    ans=0
    for j in s:
            ans+=(j*(j-1))//2
    print(ans)
"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
if __name__=="__main__":resolve()
# Original solution
N = int(eval(input()))
A = [i for i in map(int, input().split())]

def search(arr):
    if len(arr) == 1:
        if arr[0] == 0:
            return arr, 1
        else:
            return arr, 0
    kouho, count = search(arr[1:])
    next_arr = [i + arr[0] for i in kouho]
    next_arr.append(arr[0])
    count += next_arr.count(0)
    return next_arr, count

arr, count = search(A)
print(count)


# Optimized solution
N = int(eval(input()))
A = [i for i in map(int, input().split())]

count = 0
numbers = []
for i in A:
    numbers = [j + i for j in numbers]
    numbers.append(i)
    count += numbers.count(0)

print(count)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
s = [0]
s.extend([sum(a[0:i+1]) for i in range(n)])
s.sort()
result = 0

count = 1
for i in range(n):
    if s[i] == s[i+1]:
        count += 1
    else:
        result += count * (count - 1) // 2
        count = 1
result += count * (count - 1) // 2

print(result)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
s = [0]
for i in range(n):
    s.append(s[-1] + a[i])
s.sort()
result = 0

count = 1
for i in range(n):
    if s[i] == s[i+1]:
        count += 1
    else:
        result += count * (count - 1) // 2
        count = 1
result += count * (count - 1) // 2

print(result)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

A_sum = [0] * (N + 1)
for i in range(1, N+1):
    A_sum[i] = A_sum[i-1] + A[i-1]
dict = {}
for a in A_sum:
    if a in list(dict.keys()):
        dict[a] = dict[a] + 1
    else:
        dict[a] = 1
ans = 0
for num in list(dict.values()):
    ans += num * (num-1) / 2
print((int(ans)))


# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

A_sum = [0] * (N + 1)
for i in range(1, N+1):
    A_sum[i] = A_sum[i-1] + A[i-1]
A_sum.sort()

ans = 0
add = 0
a_cur = float('inf')
for a in A_sum:
    if a != a_cur:
        add = 0
        a_cur = a
    else:
        add += 1
        ans += add
print(ans)
# Original solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
S = [sum(A[:i]) for i in range(n+1)]
# num = [S.count(i) for i in set(S)]

from collections import Counter
def hello(bm):
    dt = Counter()
    for i in bm:
        key = str(i)
        dt[key] += 1
    return dt

num = hello(S)
out = [i*(i-1)//2 for i in list(num.values()) if i>1]
print((sum(out)))

# Optimized solution
from collections import Counter
n = int(eval(input()))
A = [int(i) for i in input().split()]
S = [0]*(n+1)
for i in range(n):
    S[i+1] = S[i] + A[i]
def hello(data):
    dt = Counter()
    for i in data:
        dt[str(i)] += 1
    return dt
num = hello(S)
out = [i*(i-1)//2 for i in list(num.values()) if i>1]
print((sum(out)))
# Original solution
from collections import Counter
n = int(eval(input()))
A = [int(i) for i in input().split()]
S = [0]*(n+1)
for i in range(n):
    S[i+1] = S[i] + A[i]
def hello(data):
    dt = Counter()
    for i in data:
        dt[str(i)] += 1
    return dt
num = hello(S)
out = [i*(i-1)//2 for i in list(num.values()) if i>1]
print((sum(out)))

# Optimized solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
S = [0]*(n+1)
num={}
for i in range(n):
    S[i+1] = S[i] + A[i]
for i in S:
    if str(i) in list(num.keys()):
        num[str(i)] += 1
    else:
        num[str(i)] = 1
out = [i*(i-1)//2 for i in list(num.values()) if i>1]
print((sum(out)))
# Original solution
from collections import defaultdict

N = int(eval(input()))
A = list(map(int, input().split()))
S = [0]*(N+1)
dic = defaultdict(int)
dic[0] = 1
for i in range(1,N+1):
    S[i] = S[i-1] + A[i-1]
    dic[S[i]] += 1
ans = 0
for _,v in list(dic.items()):
    if v > 0:
        ans += v*(v-1)//2
print(ans)


# Optimized solution
from collections import defaultdict

N = int(eval(input()))
A = list(map(int, input().split()))
S = [0]*(N+1)
for i in range(1,N+1):
    S[i] = S[i-1] + A[i-1]
ans = 0
dic = defaultdict(int)
for i in range(N+1):
    ans += dic[S[i]]
    dic[S[i]] += 1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
L = [A[0]]
for i in range(1,N):
  L.append(L[i-1]+A[i])
k = 0
for i in range(N):
  if (L[i] == 0):
    k += 1
  for j in range(i+1,N):
    if (L[i] - L[j] == 0):
      k += 1
print(k)

# Optimized solution
N = int(eval(input()))
L = list(map(int,input().split()))
S = [0]
c = 0
for i in range(N):
  c = S[i] + L[i]
  S.append(c)
S.sort()
S.append(S[N]+1)
k = 0
p = 1
ans = 0
while k <= N:
  if S[k] == S[k+1]:
    p += 1
    k += 1
  else:
    ans += p*(p-1)//2
    p = 1
    k += 1
print(ans)
# Original solution
import collections
n = int(eval(input()))
lis = list(map(int,input().split()))
count = 0

countArray = [0]*n
calc=0

for i in range(n):
    calc += lis[i]
    countArray[i] = calc
    if calc == 0:
        count +=1

c = collections.Counter(countArray)
for i in range(len(c.most_common())):
    counts = c.most_common()[i][1]
    if counts < 2:
        break
    count += (counts * (counts - 1)) // 2
print(count)

# Optimized solution
import collections
n = int(eval(input()))
lis = list(map(int,input().split()))
count = 0

countArray = [0]*n
calc=0

for i in range(n):
    calc += lis[i]
    countArray[i] = calc
    if calc == 0:
        count +=1

c = collections.Counter(countArray)
a = c.most_common()
for i in range(len(c.most_common())):
    counts = a[i][1]
    if counts < 2:
        break
    count += (counts * (counts - 1)) // 2
print(count)
# Original solution
from collections import Counter
from operator import mul
from functools import reduce
def main():
    def combinations_count(n, r):
        r = min(r, n - r)
        numer = reduce(mul, list(range(n, n - r, -1)), 1)
        denom = reduce(mul, list(range(1, r + 1)), 1)
        return numer // denom
    n = int(eval(input()))
    A = list(map(int, input().split()))
    B = [0, ]
    s = 0
    for i in range(n):
        s += A[i]
        B.append(s)
    C = Counter(B).most_common()
    ans = 0
    for c in C:
        if c[1] >= 2:
            ans += combinations_count(c[1], 2)
        else:
            break
    print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
from itertools import accumulate
from collections import Counter
def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    B = [0, ] + list(accumulate(A))
    c = Counter(B)
    ans = 0
    for k, v in list(c.items()):
            ans += v * (v - 1) // 2
    print(ans)

if __name__ == '__main__':
    main()
# Original solution
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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 I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

# Summarize count of factor within list -- START --
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res
# Summarize count of factor within list --- END ---

def main():
  n=I()
  l=LI()

  for i in range(n-1):
    l[i+1]+=l[i]

  l=summarize_list(l)

  ans=0
  for a,b in l:
    if a==0:
      ans+=b
      if b>1:
        ans+=b*(b-1)//2
    else:
      if b>1:
        ans+=b*(b-1)//2

  return ans

# main()
print((main()))


# Optimized solution
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

# Summarize count of factor within list -- START --
def summarizeList(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res
# Summarize count of factor within list --- END ---

def main():
  n=I()
  A=LI()

  A=[0]+A
  for i in range(n):
    A[i+1]+=A[i]

  ans=A.count(0)-1

  sl=summarizeList(A)
  # print(sl)
  for x,c in sl:
    if x==0:
      ans+=(c-1)*(c-2)//2
      continue

    ans+=c*(c-1)//2

  return ans

# main()
print((main()))
# Original solution
c=0
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(N):
  for j in range(i+1,N):
    if sum(A[i:j+1])==0:
      c=c+1
for i in range(N):
  if A[i]==0:
    c=c+1
print(c)

# Optimized solution
N=int(eval(input()))
L=list(map(int,input().split()))
R={}
sums=0
for i in range(N):
  sums+=L[i]
  if sums in R:
    R[sums]+=1
  else:
    R[sums]=1
k=0
if 0 in R:
  k=R[0]
print((sum([i*(i-1)//2 for i in list(R.values())])+k))
# Original solution
# A - Zero-Sum Ranges
from itertools import accumulate
from collections import defaultdict as dd
n=int(eval(input()))
a=[0]+list(map(int,input().split()))
acc=accumulate(a)
acc=list(acc)
acc.sort()

# print(acc)
d=dd(int)
for aa in acc:
    d[aa]+=1

ans=0
for k,v in list(d.items()):
    if v>=2:
        ans+=v*(v-1)//2
print(ans)

# Optimized solution
n=int(eval(input()))
a=[0]+list(map(int,input().split()))
from itertools import accumulate
a=accumulate(a)
a=list(a)
a.sort()
from collections import Counter
c=Counter(a)
ans=0
for k,v in list(c.items()):
    if v>=2:
        ans+=v*(v-1)//2
print(ans)
# Original solution
n=int(eval(input()))
a=[0]+list(map(int,input().split()))
from itertools import accumulate
a=accumulate(a)
a=list(a)
a.sort()
from collections import Counter
c=Counter(a)
ans=0
for k,v in list(c.items()):
    if v>=2:
        ans+=v*(v-1)//2
print(ans)


# Optimized solution
N = list(map(int, input().split()))
a = [0] + list(map(int, input().split()))
from collections import Counter
from itertools import accumulate
s = list(accumulate(a))
c = Counter(s)
ans = 0
for v in list(c.values()):
    ans += v*(v-1)//2
print(ans)
# Original solution
n=int(eval(input()))
A=list(map(int,input().split()))
s=[0]
for i in range(n):
    s.append(s[-1]+A[i])
cnt=[]
S=set(s)
for i in S:
    cnt.append(s.count(i))
ans=0
for i in cnt:
    if 1<i:
        ans+=i*(i-1)//2
print(ans)


# Optimized solution
n=int(eval(input()))
A=list(map(int,input().split()))
s=[0]
for i in range(n):
    s.append(s[-1]+A[i])
s.sort()
ans=0
cnt=1
for i in range(1,n+1):
    if s[i-1]==s[i]:
        cnt+=1
    else:
        if 2<=cnt:
            ans+=(cnt*(cnt-1))//2
            cnt=1
        else:
            cnt=1
if 2<=cnt:
    ans+=(cnt*(cnt-1))//2
print(ans)
# Original solution
from collections import Counter

def comb(n, k):
    k = min(k, n - k)
    result = 1
    for i in range(n, n - k, -1):
        result *= i
    for i in range(1, k + 1):
        result //= i 
    return result

n = int(eval(input()))
A = [int(i) for i in input().split()]

S = [0] * (n + 1)
for i in range(1, n + 1):
    S[i] = S[i - 1] + A[i - 1]
    
S = Counter(S)
ans = 0
for v in list(S.values()):
    if v > 1:
        ans += comb(v, 2)
        
print(ans)

# Optimized solution
from collections import Counter

n = int(eval(input()))
A = [int(i) for i in input().split()]

S = [0] * (n + 1)
for i in range(1, n + 1):
    S[i] = S[i - 1] + A[i - 1]
    
S = Counter(S)
ans = 0
for v in list(S.values()):
    ans += v * (v - 1) // 2
        
print(ans)
# Original solution
# -*- coding: utf-8 -*-
import collections
n = int(eval(input()))
a = [int(i) for i in input().split()]

#累積和を求める
sum_a = [0 for _ in range(n+1)]
for i in range(1, n+1):
    sum_a[i] = sum_a[i-1] + a[i-1]
#print(sum_a)

ans = 0
c = collections.Counter(sum_a)
for i in range(min(sum_a), max(sum_a)+1):
    tmp = c[i]
    if tmp >= 2:
        ans += (tmp * (tmp - 1)) // 2
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-
import collections
n = int(eval(input()))
a = [int(i) for i in input().split()]

#累積和を求める
sum_a = [0 for _ in range(n+1)]
for i in range(1, n+1):
    sum_a[i] = sum_a[i-1] + a[i-1]
#print(sum_a)

ans = 0
c = collections.Counter(sum_a)
for i in set(sum_a):
    tmp = c[i]
    if tmp >= 2:
        ans += (tmp * (tmp - 1)) // 2
print(ans)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))

cum = [0] * (n + 1)
for i in range(n):
    cum[i + 1] = cum[i] + a[i]

c = Counter(cum)
ans = 0
for v in list(c.values()):
    ans += v * (v - 1) // 2
print(ans)

# Optimized solution
from itertools import accumulate
from collections import Counter

N = int(eval(input()))
A = [0]+list(map(int, input().split()))
Acum = list(accumulate(A))
C = Counter(Acum)

ans = 0
for _, v in list(C.items()):
    ans += (v - 1) * v // 2
print(ans)
# Original solution
A, B = list(map(int, input().split()))
if A >= 13:
    print(B)
elif A <=5:
    print((0))
else:
    print((int(B/2)))

# Optimized solution
a,b=list(map(int,input().split()))
print((b if a>=13 else b//2 if 6<=a<=12 else 0))
# Original solution
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし



A,B = MI()
if A <= 5:
    print((0))
elif A >= 13:
    print(B)
else:
    print((B//2))


# Optimized solution
import sys
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))


A,B = MI()
if A <= 5:
    print((0))
elif A >= 13:
    print(B)
else:
    print((B//2))
# Original solution
a, b = list(map(int, input().split()))
if a >= 13:
  print(b)
elif 12 >= a >= 6:
  print((b//2))
else:
  print((0))

# Optimized solution
a, b = list(map(int, input().split()))

if a >= 13:
    print(b)
elif 6<=a<=12:
    print((b//2))
else:
    print((0))
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

A, B = list(map(int, input().split()))
if A <= 5:
    print((0))
elif A <= 12:
    print((int(B/2)))
else:
    print(B)


# Optimized solution
a, b = list(map(int, input().strip().split()))
if a >= 13:
    print(b)
elif a >= 6:
    print((b // 2))
else:
    print((0))
# Original solution
A, B = list(map(int, input().split()))

if A <= 5:
    print((0))
elif A <= 12:
    print((B//2))
else:
    print(B)


# Optimized solution
A, B = list(map(int, input().split()))

if A <= 5:
    B = 0
elif A <= 12:
    B //= 2

print(B)
# Original solution
i=list(map(int,input().split()))
if i[0]>=13:
  print((i[1])) 
elif i[0]>=6:
  print((int(i[1]/2)))
else:
  print("0")

# Optimized solution
a,b=list(map(int,input().split()))
if a<6:
  print((0))
elif a<13:
  print((b//2))
else:
  print(b)
# Original solution
#ABC127A - Ferris Wheel
A, B = list(map(int,input().split()))
if A >= 13:
    print(B)
if 6 <= A <= 12:
    print((B//2))
if A <= 5:
    print((0))

# Optimized solution
#ABC127A - Ferris Wheel
A, B = list(map(int,input().split()))
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print((B//2))
else:
    print((0))
# Original solution
a,b=list(map(int,input().split()))
print((b if a>=13 else b//2 if 12>=a>=6 else 0))

# Optimized solution
a, b = list(map(int, input().split()))

ans = b

if 12 >= a >= 6:
    ans = b // 2
if a <= 5:
    ans = 0

print(ans)
# Original solution
a, b = list(map(int,input().split()))

if a >= 13:
  print(b)
  
elif a >= 6:
  b //= 2
  print(b)
  
else:
  print((0))


# Optimized solution
a, b = list(map(int,input().split()))

if a >= 13:
  print(b)
  exit()
  
if a >= 6:
  b //= 2
  print(b)
  exit()
  

print((0))
# Original solution
# -*- coding: utf-8 -*-
a, b = list(map(int, input().split()))
if a >= 13:
	print(b)
elif a >= 6 and a <= 12: 
	print((int(b/2)))
else:
	print((0))


# Optimized solution
# -*- coding: utf-8 -*-

def main():
	a, b = list(map(int, input().split()))
	if a >= 13:
		print(b)
	elif a <= 12 and a >= 6:
		print((int(b / 2)))
	else:
		print((0))
if __name__ == "__main__":

	main()
# Original solution
import sys, math, collections, heapq, itertools
F = sys.stdin
def single_input(): return F.readline().strip("\n")
def line_input(): return F.readline().strip("\n").split()
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0: a, b = b, a % b
    return b
  
def solve():
    A, B = list(map(int, line_input()))
    if A >= 13: print(B)
    elif A >= 6: print((B//2))
    else: print((0))
    return 0
  
if __name__ == "__main__":
    solve()

# Optimized solution
import sys

def solve():
    input = sys.stdin.readline
    A, B = list(map(int, input().split()))
    if A <= 5: B = 0
    elif A <= 12: B //= 2
    print(B)

    return 0

if __name__ == "__main__":
    solve()
# Original solution
A, B = list(map(int, input().split()))

if A <= 5:
    print((0))
    exit()

if A <= 12:
    print((int(B/2)))
    exit()

print(B)


# Optimized solution
A, B = list(map(int, input().split()))

if 5 >= A:
    print((0))
elif 12 >= A:
    print((int(B/2)))
else:
    print(B)
# Original solution
a,b=list(map(int,input().split()))
if a>=13:
  print(b)
if a>=6 and a<=12:
  print((b//2))
if a<=5:
  print((0))

# Optimized solution
a,b=list(map(int,input().split()))
if a<=5:
  print((0))
elif a<=12:
  print((b//2))
else:
  print(b)
# Original solution
a, b = list(map(int, input().split()))
if a >= 13:
  print(b)
elif a <= 5:
  print((0))
else:
  print((b//2))

# Optimized solution
a, b = list(map(int, input().split()))
if a <= 5:
    print((0))
elif a <= 12:
    print((b//2))
else:
    print(b)
# Original solution
a,b = list(map(int,input().split()))
print((0 if a<=5 else b if a >= 13 else b//2))


# Optimized solution
a,b=list(map(int,input().split()))
if a<=5:
    print((0))
    exit()
elif 6<=a<=12:
    print((b//2))
    exit()
else:
    print(b)
# Original solution
import os, sys, re, math

A,B = [int(s) for s in input().split(' ')]

if A < 6:
    print((0))
elif 6 <= A and A <= 12:
    print((int(B/2)))
else:
    print(B)


# Optimized solution
import os, sys, re, math

A,B = list(map(int,input().split(' ')))
if A >= 13:
	print(B)
elif A >= 6:
	print((B // 2))
else:
	print((0))
# Original solution
age, fee = list(map(int, input().split()))
if age >= 13:
  print(fee)
elif 6 <= age and age <= 12:
  print((fee // 2))
else:
  print((0))

# Optimized solution
a, b = list(map(int, input().split()))
if a >= 13:
  print(b)
elif a <= 5:
  print((0))
else:
  print((int(b/2)))
# Original solution
A,B = list(map(int,input().split()))
 
if A >= 13:
  print(B)
elif 6<=A<=12:
  print((B//2))
else:
  print("0")

# Optimized solution
#! python3
#  solve127A.py

age,cost = list(map(int,input().split()))

if age <= 5:
    cost = 0
elif 6 <= age <= 12:
    cost = cost//2
elif 7 <= age:
    cost = cost

print(cost)
# Original solution
A,B = list(map(int,input().split()))

if 13 <= A:
    print(B)
elif (6 <= A) and (A<=12):
    print((B//2))
else:
    print((0))


# Optimized solution
a,b = list(map(int,input().split()))

if a >= 13:
    print(b)
elif (6 <=a<= 12):
    print((b//2))
else:
    print("0")
# Original solution
N, W = list(map(int, input().split()))
if N >=13:
  print(W)
elif N >=6:
  print((W//2))
else:
  print((0))

# Optimized solution
A, B = list(map(int, input().split()))
if A >= 13:
    print(B)
elif A >= 6:
    print((B//2))
else:
    print((0))
# Original solution
A, B = list(map(int,input().split()))

if A < 6:
    print((0))
elif A < 13:
    print((int(B / 2)))
else:
    print(B)


# Optimized solution
A,B=list(map(int,input().split()))

if 13<=A:
    print((int(B)))
if 6<=A and A<=12:
    print((int(B/2)))
if A<=5:
    print((int(0)))
# Original solution
a,b = list(map(int,input().split()))
if a<6:
  print('0')
elif 6<=a<=12:
  print((int(b/2)))
else:
  print(b)

# Optimized solution
a,b = list(map(int,input().split()))
if a>=13:
    print(b)
elif 6<=a<=12:
    print((int(b/2)))
else:
    print('0')
# Original solution
A,B = list(map(int,input().split()))
if A <= 5:
    print((0))
elif 6 <= A <= 12:
    print((B//2))
else:
    print(B)

# Optimized solution
A,B = list(map(int,input().split()))

if A >= 13:
    print(B)
elif A >= 6:
    print((B//2))
else:
    print((0))
# Original solution
def bomb(x,y):
    global M
    s=M[y+2]
    R=[-3,-2,-1,1,2,3]
    if s[x+2]=="0":return
    M[y+2]=s[:x+2]+"0"+s[x+3:]
    for d in R:
        bomb(x+d,y)
        bomb(x,y+d)
    return

A=list(range(14))
B=list(range(8))
M=["00000000000000" for i in A]
z="000"
n=eval(input())
for i in range(n):
    s=input()
    for j in B:
        M[j+3]=z+input()+z
    x=eval(input())
    y=eval(input())
    bomb(x,y)
    print("Data %d:" %(i+1))
    for j in B:
        print(M[j+3][3:-3])

# Optimized solution
def bomb(x,y):
    global M
    s=M[y+2]
    R=[-3,-2,-1,1,2,3]
    if s[x+2]=="0":return
    M[y+2]=s[:x+2]+"0"+s[x+3:]
    for d in R:
        bomb(x+d,y)
        bomb(x,y+d)
    return

A=list(range(14))
B=list(range(3,11))
M=["00000000000000" for i in A]
z="000"
n=eval(input())
for i in range(n):
    s=input()
    for j in B:
        M[j]=z+input()+z
    x=eval(input())
    y=eval(input())
    bomb(x,y)
    print("Data %d:" %(i+1))
    for j in B:
        print(M[j][3:-3])