"use strict"
function Main(input) {
  const array = input.split(" ")
  if(array.length == 2){
    const curtain = array[1]*2;
    console.log(array[0] > curtain ? array[0] - curtain : 0)
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));