def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())

a,b=ma()
if a>2*b:
  print(a-2*b)
else: 
  print(0) def ri(): return int(input()) ri def rli(): return list(map(int, input().split())) rli def rls(): return list(map(str, input().split())) rls def pl(a): print(" ".join(list(map(str, a)))) pl a a def ma():return map(int,input().split()) ma a,b=ma() a ma() ma b if a>2*b:
  print(a-2*b)
else: 
  print(0) a>2*b a 2*b 2 b print(a-2*b) print a-2*b a 2*b 2 b print(0) print 0 def ri(): return int(input()) def ri(): return int(input()) ri b=ma() ma() b def rls(): return list(map(str, input().split())) def rls(): return list(map(str, input().split())) rls a,b=ma() ma() a def rli(): return list(map(int, input().split())) def rli(): return list(map(int, input().split())) rli def ma():return map(int,input().split()) def ma():return map(int,input().split()) ma def pl(a): print(" ".join(list(map(str, a)))) def pl(a): print(" ".join(list(map(str, a)))) pl
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())

a,b=ma()
if a>2*b:
  print(a-2*b)
else: 
  print(0)