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 A > 12:

    print(B)

else:

    print((B // 2))
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 A > 12:
    print(B)
else:
    print((B // 2))

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