{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}

main :: IO ()
main = print =<< solve <$> getInput

getInput :: IO (Int, Int, Int, Int)
getInput = (,,,) <$> readLn <*> readLn <*> readLn <*> readLn

solve :: (Int, Int, Int, Int) -> Int
solve (a, b, c, x) =
  length [ (a', b', c')
         | a' <- [0 .. a]
         , b' <- [0 .. b]
         , c' <- [0 .. c]
         , 500 * a' + 100 * b' + 50 * c' == x
         ]
