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

print((0 if a<=5 else b if a >= 13 else b//2))

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

if a<=5:

    print((0))

    exit()

elif 6<=a<=12:

    print((b//2))

    exit()

else:

    print(b)
a, b = list(map(int, input().split()))
print((0 if a <= 5 else b if a >= 13 else b // 2))

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

-print((0 if a <= 5 else b if a >= 13 else b // 2)) +if a <= 5: +    print((0)) +    exit() +elif 6 <= a <= 12: +    print((b // 2)) +    exit() +else: +    print(b)