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



if A < 6:

    print((0))

elif A < 13:

    print((int(B / 2)))

else:

    print(B)

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)))
A, B = list(map(int, input().split()))
if A < 6:
    print((0))
elif A < 13:
    print((int(B / 2)))
else:
    print(B)

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)))

-if A < 6: -    print((0)) -elif A < 13: +if 13 <= A: +    print((int(B))) +if 6 <= A and A <= 12: -else: -    print(B) +if A <= 5: +    print((int(0)))