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

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

c=a-2*b
if c<0:
    c=0
print(c)