function Main(input) {
    var A = parseInt(input[0], 10);
    var B = parseInt(input[1], 10);

    var result = A - 2 * B;

    console.log(result < 0 ? 0 : result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));