import sys

a, b = map(int, sys.stdin.readline().split())

def main():
    r = max(0, a - b * 2)
    print(r)

if __name__ ==  '__main__':
    main() import sys sys a, b = map(int, sys.stdin.readline().split()) a map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split b def main():
    r = max(0, a - b * 2)
    print(r) main r = max(0, a - b * 2) r max(0, a - b * 2) max 0 a - b * 2 a b * 2 b 2 print(r) print r if __name__ ==  '__main__':
    main() __name__ ==  '__main__' __name__ '__main__' main() main b = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) b def main():
    r = max(0, a - b * 2)
    print(r) def main():
    r = max(0, a - b * 2)
    print(r) main a, b = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) a
import sys

a, b = map(int, sys.stdin.readline().split())

def main():
    r = max(0, a - b * 2)
    print(r)

if __name__ ==  '__main__':
    main()