A,B = map (int, input ().split ())
X = A-B*2
if X < 0:
  print (0)
else:
  print (X) A,B = map (int, input ().split ()) A map (int, input ().split ()) map int input ().split () ().split () input split B X = A-B*2 X A-B*2 A B*2 B 2 if X < 0:
  print (0)
else:
  print (X) X < 0 X 0 print (0) print 0 print (X) print X X = A-B*2 A-B*2 X 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 ())
X = A-B*2
if X < 0:
  print (0)
else:
  print (X)