def resolve():
    A, B = list(map(int, input().split()))
    print(max(A-2*B, 0))
    
if '__main__' == __name__:
    resolve() def resolve():
    A, B = list(map(int, input().split()))
    print(max(A-2*B, 0))
     resolve A, B = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split B print(max(A-2*B, 0)) print max(A-2*B, 0) max A-2*B A 2*B 2 B 0 if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    A, B = list(map(int, input().split()))
    print(max(A-2*B, 0))
     def resolve():
    A, B = list(map(int, input().split()))
    print(max(A-2*B, 0))
     resolve
def resolve():
    A, B = list(map(int, input().split()))
    print(max(A-2*B, 0))
    
if '__main__' == __name__:
    resolve()