main :: IO ()
main = do
  [r, g, b, n] <- map read . words <$> getLine
  print $ solve r g b n

solve :: Int -> Int -> Int -> Int -> Int
solve r g b n = length
  [ (l, m, p)
  | l <- [0 .. n]
  , m <- [0 .. n - r * l]
  , let (p, q) = (n - r * l - g * m) `divMod` b
  , q == 0
  , p >= 0
  ]
