'use strict';

const testcase = null;

function main(input) {
    const a = parseInt(input.shift());
    const b = parseInt(input.shift());
    console.log(Math.max(0, a - b * 2));
}

if (process.argv[1] == __filename) {
    const input = testcase
        || require('fs')
            .readFileSync('/dev/stdin', 'utf-8');
    main(input.split(/\s/));
}
