solve a b c x = do
  d <- [0..a]
  e <- [0..b]
  f <- [0..c]
  if 500*d+100*e+50*f==x
    then return x
    else []

main = do
  a <- readLn
  b <- readLn
  c <- readLn
  x <- readLn
  putStrLn $ show $ length $ solve a b c x
