r, g, b, n = gets.chomp.split.map(&:to_i)
gc = (r.gcd(g)).gcd(b)
r /= gc
g /= gc
b /= gc
n /= gc
r, g, b = [r, g, b].sort

res = 0
0.step(n / b) do |k|
  0.step((n - k * b) / g) do |j|
    res += 1
  end
end
puts res