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



ans = a - b * 2

if ans < 0:

    ans = 0



print (ans)



#k = int(input())

#s = input()

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

#s, t = map(str, input().split())

#l = list(map(int, input().split()))



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



ans = a - b * 2



if (ans >= 0):

    print(ans)

else:

    print((0))



a, b = list(map(int, input().split()))
ans = a - b * 2
if ans < 0:
    ans = 0
print(ans)

# k = int(input())
# s = input()
# a, b = map(int, input().split())
# s, t = map(str, input().split())
# l = list(map(int, input().split()))
a, b = list(map(int, input().split()))
ans = a - b * 2
if ans >= 0:
    print(ans)
else:
    print((0))

+# k = int(input()) +# s = input() +# a, b = map(int, input().split()) +# s, t = map(str, input().split()) +# l = list(map(int, input().split())) -if ans < 0: -    ans = 0 -print(ans) +if ans >= 0: +    print(ans) +else: +    print((0))