open System
open System.Linq;


let input =stdin.ReadLine().Split() |> Array.map int
let A=input.[0]
let B=input.[1]
[<EntryPoint>]
let sf argv =
    let ans = if A-2*B >0 then A-2*B else 0
    printfn "%d" ans
    0 