function main(input) {
    const args = input.split(' ');
    const A = parseInt(args[0], 10),
          B = parseInt(args[1], 10);
    const left = A - B * 2;
    if (left < 0) console.log(0);
    console.log(left);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));