from sys import stdin, setrecursionlimit





def main():

    input = stdin.buffer.readline

    a, b = list(map(int, input().split()))

    print((max(0, a - 2 * b)))





if __name__ == "__main__":

    setrecursionlimit(10000)

    main()

from sys import stdin, setrecursionlimit





def main():

    input = stdin.buffer.readline

    a, b = list(map(int, input().split()))

    if a - 2 * b >= 0:

        print((a - 2 * b))

    else:

        print((0))





if __name__ == "__main__":

    setrecursionlimit(10000)

    main()

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = list(map(int, input().split()))
    print((max(0, a - 2 * b)))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b = list(map(int, input().split()))
    if a - 2 * b >= 0:
        print((a - 2 * b))
    else:
        print((0))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

-    print((max(0, a - 2 * b))) +    if a - 2 * b >= 0: +        print((a - 2 * b)) +    else: +        print((0))