def q1():
    A,B = (int(i) for i in input().split())
    ans = max(0, A - B*2)
    print(ans)


if __name__ == '__main__':
    q1() def q1():
    A,B = (int(i) for i in input().split())
    ans = max(0, A - B*2)
    print(ans) q1 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A,B = (int(i) for i in input().split()) A (int(i) for i in input().split()) B ans = max(0, A - B*2) ans max(0, A - B*2) max 0 A - B*2 A B*2 B 2 print(ans) print ans if __name__ == '__main__':
    q1() __name__ == '__main__' __name__ '__main__' q1() q1 def q1():
    A,B = (int(i) for i in input().split())
    ans = max(0, A - B*2)
    print(ans) def q1():
    A,B = (int(i) for i in input().split())
    ans = max(0, A - B*2)
    print(ans) q1
def q1():
    A,B = (int(i) for i in input().split())
    ans = max(0, A - B*2)
    print(ans)


if __name__ == '__main__':
    q1()
