'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const A = parseInt(args[0][0], 10)
	const B = parseInt(args[0][1], 10)

	const t1 = A - (B * 2)

	if (t1 < 0) console.log(0)
	else console.log(t1)
}

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