function Main(input) {

	input = input.split(" ");
  var A = input[0];
  var B = input[1];  
  if(A-B*2<0){
    console.log("0");
  }else{
  console.log(A-B*2);
}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
