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

X=A-2*B

if X>=1:
    print(X)
    
else:
    print("0") A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B X=A-2*B X A-2*B A 2*B 2 B if X>=1:
    print(X)
    
else:
    print("0") X>=1 X 1 print(X) print X print("0") print "0" X=A-2*B A-2*B X A,B=map(int,input().split()) map(int,input().split()) A B=map(int,input().split()) map(int,input().split()) B
A,B=map(int,input().split())

X=A-2*B

if X>=1:
    print(X)
    
else:
    print("0")