function Main(input){
  input = input.split("\n");
  inputStr = input[0].split(" ");
  const A = Number.parseInt(inputStr[0]);
  const B = Number.parseInt(inputStr[1]);
  //結果
  console.log((A-B*2) < 0? 0 : (A-B*2));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));