r, g, b, n = gets.split.map(&:to_i)
cnt = 0
(0..n/r).map do |i|
  (0..(n/g)).map do |j|
    (0..n/b).map do |k|
      break if (i * r) + (j * g) + (k * b) > n
      cnt += 1 if (i * r) + (j * g) + (k * b) == n
    end
  end
end
puts cnt