def main():
    A,B = list(map(int,input().split()))

    result = A - B * 2

    if(result >= 0):
        print(result)
    else:
        print(0)

if __name__ == "__main__":
    main() def main():
    A,B = list(map(int,input().split()))

    result = A - B * 2

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

    result = A - B * 2

    if(result >= 0):
        print(result)
    else:
        print(0) def main():
    A,B = list(map(int,input().split()))

    result = A - B * 2

    if(result >= 0):
        print(result)
    else:
        print(0) main
def main():
    A,B = list(map(int,input().split()))

    result = A - B * 2

    if(result >= 0):
        print(result)
    else:
        print(0)

if __name__ == "__main__":
    main()