main = do
    a <- read <$> getLine
    b <- read <$> getLine
    c <- read <$> getLine
    x <- read <$> getLine
    print $ solve a b c x

{-500円玉a枚と100円玉b枚と50円玉c枚でx円を払い方法の数-}
solve :: Int -> Int -> Int -> Int -> Int
solve a b c x = sum [g b c (x - 500*c') | c' <- [0..a] ]

{-100円玉b枚と50円玉c枚でx円を払う方法の数-}
g :: Int -> Int -> Int -> Int
g b c x = sum [h c (x - 100*b') | b' <- [0..b] ]

{-50円玉c枚でx円を払う方法の数-}
h :: Int -> Int -> Int
h c x | x >= 0 = if 50 * c >= x then 1 else 0
      | x < 0 = 0
