main :: IO ()
main = do
  a <- readLn :: IO Int
  b <- readLn :: IO Int
  c <- readLn :: IO Int
  x <- readLn :: IO Int
  print $ sum $ solve a b c x

solve a b c x = do
  i <- [0 .. a]
  j <- [0 .. b]
  k <- [0 .. c]
  if 500 * i + 100 * j + 50 * k == x
    then return 1
    else return 0
