# -*- coding: utf-8 -*-
"""
A - Curtain
https://atcoder.jp/contests/abc143/tasks/abc143_a

"""
import sys


def solve(A, B):
    return max(0, A - B * 2)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:]) """
A - Curtain
https://atcoder.jp/contests/abc143/tasks/abc143_a

""" import sys sys def solve(A, B):
    return max(0, A - B * 2) solve return max(0, A - B * 2) max(0, A - B * 2) max 0 A - B * 2 A B * 2 B 2 A A B B def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans) main A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B ans = solve(A, B) ans solve(A, B) solve A B print(ans) print ans args args if __name__ == '__main__':
    main(sys.argv[1:]) __name__ == '__main__' __name__ '__main__' main(sys.argv[1:]) main sys.argv[1:] sys.argv sys argv 1: 1 def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans) def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans) main def solve(A, B):
    return max(0, A - B * 2) def solve(A, B):
    return max(0, A - B * 2) solve
# -*- coding: utf-8 -*-
"""
A - Curtain
https://atcoder.jp/contests/abc143/tasks/abc143_a

"""
import sys


def solve(A, B):
    return max(0, A - B * 2)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
