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