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


if __name__ == '__main__':

    ABC_143_A() def ABC_143_A():
    A,B = map(int, input().split())
    if A - 2*B >= 0:
        print(A-2*B)
    else:
        print(0) ABC_143_A 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)
    else:
        print(0) 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 print(0) print 0 if __name__ == '__main__':

    ABC_143_A() __name__ == '__main__' __name__ '__main__' ABC_143_A() ABC_143_A def ABC_143_A():
    A,B = map(int, input().split())
    if A - 2*B >= 0:
        print(A-2*B)
    else:
        print(0) def ABC_143_A():
    A,B = map(int, input().split())
    if A - 2*B >= 0:
        print(A-2*B)
    else:
        print(0) ABC_143_A
def ABC_143_A():
    A,B = map(int, input().split())
    if A - 2*B >= 0:
        print(A-2*B)
    else:
        print(0)


if __name__ == '__main__':

    ABC_143_A()