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



if 13 <= A:

    print(B)

elif (6 <= A) and (A<=12):

    print((B//2))

else:

    print((0))

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



if a >= 13:

    print(b)

elif (6 <=a<= 12):

    print((b//2))

else:

    print("0")

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

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

-A, B = list(map(int, input().split())) -if 13 <= A: -    print(B) -elif (6 <= A) and (A <= 12): -    print((B // 2)) +a, b = list(map(int, input().split())) +if a >= 13: +    print(b) +elif 6 <= a <= 12: +    print((b // 2)) -    print((0)) +    print("0")