# https://atcoder.jp/contests/diverta2019/tasks/diverta2019_b

r, g, b, n = gets.split.map(&:to_i)
# dp[r][g][b] = sum
dp = Array.new(3000).map { Array.new(3000) }.map { Array.new(3000) }

res = 0

0.upto(n / r) do |i|
  break if i * r > n
  0.upto(n / g) do |j|
    rest = n - (i * r + j * g)
    break if rest < 0
    res += 1 if rest % b == 0
  end
end

puts res