import Control.Applicative
import Control.Monad

main :: IO ()
main = do
    [r, g, b, n] <- map read . words <$> getLine
    print $ length [() |
        nr <- [0..(div n r)],
        ng <- [0..(div n g)],
        nb <- [0..(div n b)],
        nr*r + ng*g + nb*b == n]

