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

count = 0
0.upto(3_000).each do |i|
  rc = r * i
  break if rc > n
  0.upto(3_000).each do |j|
    gc = g * j
    res = n - rc - gc
    break if res < 0
    count += 1 if res % b == 0
  end
end
puts count
