import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    a, b = input_nums()
    if b*2 >= a:
        print(0)
    else:
        print(a-b*2)

if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip input_nums = lambda: list(map(int, input().split())) input_nums lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def main():
    a, b = input_nums()
    if b*2 >= a:
        print(0)
    else:
        print(a-b*2) main a, b = input_nums() a input_nums() input_nums b if b*2 >= a:
        print(0)
    else:
        print(a-b*2) b*2 >= a b*2 b 2 a print(0) print 0 print(a-b*2) print a-b*2 a b*2 b 2 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a, b = input_nums()
    if b*2 >= a:
        print(0)
    else:
        print(a-b*2) def main():
    a, b = input_nums()
    if b*2 >= a:
        print(0)
    else:
        print(a-b*2) main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input input_nums = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) input_nums
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    a, b = input_nums()
    if b*2 >= a:
        print(0)
    else:
        print(a-b*2)

if __name__ == '__main__':
    main()