function Main(input) {
  input = input.split('\n');
  tmp = input[0].split(' ');
  var a = parseInt(tmp[0], 10);
  var b = parseInt(tmp[1], 10);
  var result;
  if (a <= b * 2) {
    result = 0;
  } else {
    result = a - b * 2;
  }
  console.log(result);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));