module Main where

import Data.Char
import Data.List

main :: IO ()
main = do
  ints <- fmap (map read . words) getLine
  putStrLn $ show $ solve ints

solve :: [Int] -> Int
solve [a, b] = max 0 $ a - b * 2