function main(arg) {
	arg = arg.trim().split(' ');
  	arg = arg.map(str => parseInt(str, 10));
  	var a = arg[0], b = arg[1] * 2;
  	if (a <= b) {
    	console.log(0);
    } else {
    	console.log(a-b);
    } 
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));