const main = input => {
    const [A, B] = input.split(' ').map(x => parseInt(x));
    console.log(Math.max(0, A - 2 * B));
};

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"));
// main(require("fs").readFileSync("input.txt", "utf8"));