import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

print(max(A-2*B,0)) import sys, math sys math input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline rs = lambda: input().strip() rs lambda: input().strip() input().strip() ().strip () input strip ri = lambda: int(input()) ri lambda: int(input()) int(input()) int input() input rl = lambda: list(map(int, input().split())) rl lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 A, B = rl() A rl() rl B print(max(A-2*B,0)) print max(A-2*B,0) max A-2*B A 2*B 2 B 0 A, B = rl() rl() A B = rl() rl() B rs = lambda: input().strip() lambda: input().strip() rs rl = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) rl input = sys.stdin.readline sys.stdin.readline input mod = 10**9 + 7 10**9 + 7 mod ri = lambda: int(input()) lambda: int(input()) ri
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

print(max(A-2*B,0))
