r, g, b, n = gets.split.map(&:to_i)

ans = 0
(0..(n/r)).each do |rr|
  next if rr*r > n
  (0..(n/g)).each do |gg|
    next if rr*r + gg*g > n
    ans += 1 if ((n - rr*r - gg*g) % b).zero?
  end
end

puts ans