main = do
    [r, g, b, n] <- map read . words <$> getLine
    print $ length [() |
        i <- [0..(div n r)],
        j <- [0..(div n g)],
        n >= i*r + j*g,
        (n - i*r - j*g) `mod` b == 0]