from sys import stdin

def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if A > 2*B:
        print(A - 2*B)
    else:
        print(0)
main() from sys import stdin def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if A > 2*B:
        print(A - 2*B)
    else:
        print(0) main int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x A, B = [int(x) for x in stdin.readline().rstrip().split()] A [int(x) for x in stdin.readline().rstrip().split()] B if A > 2*B:
        print(A - 2*B)
    else:
        print(0) A > 2*B A 2*B 2 B print(A - 2*B) print A - 2*B A 2*B 2 B print(0) print 0 main() main def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if A > 2*B:
        print(A - 2*B)
    else:
        print(0) def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if A > 2*B:
        print(A - 2*B)
    else:
        print(0) main
from sys import stdin

def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    if A > 2*B:
        print(A - 2*B)
    else:
        print(0)
main()