import Control.Monad.State

getInts = map read . words <$> getLine :: IO [Int]
getInt = read <$> getLine :: IO Int

data Coins = Coins {_a::Int,_b::Int,_c::Int}
main = do
    (a:b:c:_) <- replicateM 3 getInt
    money <- getInt
    putStrLn . show $ pay money (Coins a b c)
    return undefined

pay money (Coins a b c)
    | a == 0 && b == 0 = if money `mod` 50 == 0 && money <= c * 50 then 1 else 0
    | a == 0 = foldr1 (+) $ map (\x -> pay x (Coins 0 0 c)) $ makeZipped b 100
    | otherwise = foldr1 (+) $ map (\x -> pay x (Coins 0 b c)) $makeZipped a 500
    where makeZipped num price = takeWhile (\x -> x >= 0) $ map (\(bb, mon) -> mon - bb * price) $ take (b + 1) $ zip ([0..]) (repeat money)