import Control.Applicative ((<$>))
import Control.Monad (replicateM)
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
  solve <$> replicateM 4 (getl $ readi B.readInt) >>= print

solve :: [Int] -> Int
solve [a, b, c, x] = sum $ [1 | i <- [0..a], j <- [0..b], k <- [0..c], i * 500 + j * 100 + k * 50 == x]

getl :: (ByteString -> a) -> IO a
getl f = f <$> B.getLine

readi :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> a
readi f s = let Just (n, _) = f s in n
