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