module Main where

toInt :: String -> Int
toInt s = read s :: Int

strToIntList :: String -> [Int]
strToIntList = map toInt . words

getIntList :: IO [Int]
getIntList = getLine >>= return . strToIntList

main :: IO ()
main = do
  a <- getLine
  b <- getLine
  c <- getLine
  x <- getLine
  let (n500, n100, n50, sum) = (toInt a, toInt b, toInt c, toInt x)
  print $ length
    [ (c500, c100, c50)
    | c500 <- [0 .. n500]
    , c100 <- [0 .. n100]
    , c50  <- [0 .. n50]
    , c500 * 500 + c100 * 100 + c50 * 50 == sum
    ]
