function Main(input) {
    var data = input.split(" ")
    var nokori = parseInt(data[0]) - parseInt(data[1])*2;
    if(nokori <= 0){
    	console.log(0)
	}else{
		console.log(nokori)
	}
}
 
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));