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

if A <= 5:

    print((0))

elif 6 <= A <= 12:

    print((B//2))

else:

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



if A >= 13:

    print(B)

elif A >= 6:

    print((B//2))

else:

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

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

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