A, B = input().split()
A=int(A)
B=int(B)

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

if A-2*B>=0:
  print(A-2*B)
elif A-2*B<0:
  print(0)