a,b = (int(x) for x in input().split())

result = a - b * 2

if result <= 0:
    print(0)
else:
    print(result) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a,b = (int(x) for x in input().split()) a (int(x) for x in input().split()) b result = a - b * 2 result a - b * 2 a b * 2 b 2 if result <= 0:
    print(0)
else:
    print(result) result <= 0 result 0 print(0) print 0 print(result) print result a,b = (int(x) for x in input().split()) (int(x) for x in input().split()) a result = a - b * 2 a - b * 2 result b = (int(x) for x in input().split()) (int(x) for x in input().split()) b
a,b = (int(x) for x in input().split())

result = a - b * 2

if result <= 0:
    print(0)
else:
    print(result)