'use strict';
const main = input => {
  input = input[0].split(' ');
  const a = parseInt(input[0]),b = parseInt(input[1]);
  console.log(a-2*b>0?a-2*b:0);
  
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));