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

if a <= b:
    print("0")
elif a <= b*2:
    print("0")
else:
    print(a-b*2) a, b = input().split() a input().split() ().split () input split b a = int(a) a int(a) int a b = int(b) b int(b) int b if a <= b:
    print("0")
elif a <= b*2:
    print("0")
else:
    print(a-b*2) a <= b a b print("0") print "0" elif a <= b*2:
    print("0") a <= b*2 a b*2 b 2 print("0") print "0" print(a-b*2) print a-b*2 a b*2 b 2 b = input().split() input().split() b a = int(a) int(a) a b = int(b) int(b) b a, b = input().split() input().split() a
a, b = input().split()
a = int(a)
b = int(b)

if a <= b:
    print("0")
elif a <= b*2:
    print("0")
else:
    print(a-b*2)