import sys

def S(): return sys.stdin.readline().rstrip()

A,B = map(int,S().split())

print(max(0,A-2*B)) import sys sys def S(): return sys.stdin.readline().rstrip() S A,B = map(int,S().split()) A map(int,S().split()) map int S().split() ().split () S split B print(max(0,A-2*B)) print max(0,A-2*B) max 0 A-2*B A 2*B 2 B A,B = map(int,S().split()) map(int,S().split()) A def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S B = map(int,S().split()) map(int,S().split()) B
import sys

def S(): return sys.stdin.readline().rstrip()

A,B = map(int,S().split())

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