r, g, b, n = gets.split.map(&:to_i)
rgs = Array.new(n + 1, 0)
(0..(n / r)).each do |rxc|
  rbc = r * rxc
  (0..((n - rbc) / g)).each do |gxc|
    gbc = g * gxc
    rgs[rbc + gbc] += 1
  end
end
res = (0..(n / b)).sum do |bxc|
  rgs[n - b * bxc]
end
p res