function main (input) {
  input = input.split(' ')
  const a = parseInt(input[0])
  const b = parseInt(input[1])
  console.log(Math.max(a - 2 * b, 0))
}

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