import Data.List (foldl')

func :: Int -> [(Int, Int, Int)] -> Int
func x xs = foldl' (\acc (a,b,c) ->
  if a * 500 + b * 100 + c * 50 == x
  then acc + 1
  else acc) 0 xs

main = do
  contents <- getContents
  let
    [a',b',c',x] = map read $ lines contents :: [Int]
    ans = func x [(a,b,c) | a <- [0..a'], b <- [0..b'], c <- [0..c']]
  putStrLn $ show ans
