#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 = map(int, input().split())

ans = a - b * 2

if (ans >= 0):
    print(ans)
else:
    print(0)
 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b ans = a - b * 2 ans a - b * 2 a b * 2 b 2 if (ans >= 0):
    print(ans)
else:
    print(0) ans >= 0 ans 0 print(ans) print ans print(0) print 0 ans = a - b * 2 a - b * 2 ans b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
#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 = map(int, input().split())

ans = a - b * 2

if (ans >= 0):
    print(ans)
else:
    print(0)

