"use strict";

const main = args => {

    const input = args.trim().split(" ");
    const a = parseInt(input[0]);
    const b = parseInt(input[1]);

    console.log(Math.max(0, a - 2 * b));
}

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