main = do
  s <- getContents
  let [a, b, c, x] = map read . lines $ s
  print $ select a b c x

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