import Control.Applicative
import Control.Monad
 
main :: IO ()
main = do
    [a, b] <- map read . words <$> getLine
    putStrLn $ show (solve a b)
    
solve :: Int -> Int -> Int
solve a b = if a - 2 * b >= 0 then a - 2 * b else 0