x = input().split()
A = int(x[0])
B = int(x[1])

n = A -2*B

if n >=0:
  print(n)
else:
  print(0) x = input().split() x input().split() ().split () input split A = int(x[0]) A int(x[0]) int x[0] x 0 B = int(x[1]) B int(x[1]) int x[1] x 1 n = A -2*B n A -2*B A 2*B 2 B if n >=0:
  print(n)
else:
  print(0) n >=0 n 0 print(n) print n print(0) print 0 A = int(x[0]) int(x[0]) A n = A -2*B A -2*B n B = int(x[1]) int(x[1]) B x = input().split() input().split() x
x = input().split()
A = int(x[0])
B = int(x[1])

n = A -2*B

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