def curtain(x,y):
  if (2*b>=a):
    return 0;
  else:
    return (a-(2*b))
a,b=map(int,input().split())
print(curtain(a,b)) def curtain(x,y):
  if (2*b>=a):
    return 0;
  else:
    return (a-(2*b)) curtain if (2*b>=a):
    return 0;
  else:
    return (a-(2*b)) 2*b>=a 2*b 2 b a return 0 0 return (a-(2*b)) a-(2*b) a 2*b 2 b x x y y a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b print(curtain(a,b)) print curtain(a,b) curtain a b def curtain(x,y):
  if (2*b>=a):
    return 0;
  else:
    return (a-(2*b)) def curtain(x,y):
  if (2*b>=a):
    return 0;
  else:
    return (a-(2*b)) curtain a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
def curtain(x,y):
  if (2*b>=a):
    return 0;
  else:
    return (a-(2*b))
a,b=map(int,input().split())
print(curtain(a,b))