main = do
  li <-getLine
  let [r,g,b,n] = map read $ words li
  let ans = compute r g b n
  print ans

compute :: Int -> Int -> Int -> Int -> Int
compute r g b n0 = length
  [ ()
  | x <- [0,r..n0], let n1 = n0-x
  , y <- [0,g..n1], let n2 = n1-y
  , mod n2 b == 0
  ]