function Main(input) {
    input = input.split(" ");
    var a = parseInt(input[0], 10);
    var b = parseInt(input[1], 10);
    var ans = a-2*b;

    if(ans >= 0) console.log('%d',ans);
    else console.log(0);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

