"use strict"

const arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8').split(' ')
const A = +arg_str[0]
const B = +arg_str[1]

if(A > B*2){
    console.log(A - B*2)
}else{
    console.log(0)
}