import Data.Maybe
solve :: [Int] -> Maybe Int
solve [a,b]
 | doubledB > a = Nothing
 | otherwise = return $ a - doubledB
  where doubledB = b * 2
main = print =<< (fromMaybe (0)) . solve . map read . words <$> getLine