N = list(map(int, input().split())) 
R = N[0]-2*N[1]
if R <= 0:
  print (0)
else:
  print (R) N = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split R = N[0]-2*N[1] R N[0]-2*N[1] N[0] N 0 2*N[1] 2 N[1] N 1 if R <= 0:
  print (0)
else:
  print (R) R <= 0 R 0 print (0) print 0 print (R) print R N = list(map(int, input().split())) list(map(int, input().split())) N R = N[0]-2*N[1] N[0]-2*N[1] R
N = list(map(int, input().split())) 
R = N[0]-2*N[1]
if R <= 0:
  print (0)
else:
  print (R)