A,B = map(int,input().split())
if A-2*B>0:
    print(A-2*B)
elif A -2*B<=0:
    print(0)
else:
    pass A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B if A-2*B>0:
    print(A-2*B)
elif A -2*B<=0:
    print(0)
else:
    pass A-2*B>0 A-2*B A 2*B 2 B 0 print(A-2*B) print A-2*B A 2*B 2 B elif A -2*B<=0:
    print(0) A -2*B<=0 A -2*B A 2*B 2 B 0 print(0) print 0 B = map(int,input().split()) map(int,input().split()) B A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())
if A-2*B>0:
    print(A-2*B)
elif A -2*B<=0:
    print(0)
else:
    pass