def curtain(a, b):

    return a-b*2 if a > b*2 else 0
def main():
    a, b = map(int, input().split())
    print(curtain(a, b))

if __name__ == '__main__':
    main() def curtain(a, b):

    return a-b*2 if a > b*2 else 0 curtain return a-b*2 if a > b*2 else 0 a-b*2 if a > b*2 else 0 a > b*2 a b*2 b 2 a-b*2 a b*2 b 2 0 a a b b def main():
    a, b = map(int, input().split())
    print(curtain(a, b)) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b print(curtain(a, b)) print curtain(a, b) curtain a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a, b = map(int, input().split())
    print(curtain(a, b)) def main():
    a, b = map(int, input().split())
    print(curtain(a, b)) main def curtain(a, b):

    return a-b*2 if a > b*2 else 0 def curtain(a, b):

    return a-b*2 if a > b*2 else 0 curtain
def curtain(a, b):

    return a-b*2 if a > b*2 else 0
def main():
    a, b = map(int, input().split())
    print(curtain(a, b))

if __name__ == '__main__':
    main()
