toInt :: String -> Int
toInt = read :: String -> Int

getAnsList :: (Int, Int, Int, Int) -> [(Int, Int, Int)]
getAnsList (r, g, b, n) = [(rc, gc, bc) | rc <- [0..rm], gc <- [0..gm], let bc = div (n-rc*r-gc*g) b, bc >= 0, rc*r+gc*g+bc*b == n]
  where
    rm = div n r
    gm = div n g

main = do
  [r, g, b, n] <- map toInt . words <$> getLine
  print $ length $ getAnsList (r, g, b, n)
