module Main where

import Data.Maybe (fromJust)
import Data.List
import qualified Data.ByteString.Char8 as BS


bytestr2Int = fst . fromJust . BS.readInt
getInt = bytestr2Int <$> BS.getLine
getIntL_H = map bytestr2Int. BS.words <$> BS.getLine
getIntL_V n = replicate n $ getInt
getInt2D n = replicate n $ getIntL_H


main :: IO ()
main = do
    [w,k] <- getIntL_H
    let r = w - k * 2
    print $ if r < 0 then 0 else r

