r, g, b, n = gets.chomp.split(' ').map(&:to_i)
min, mid, max = [r, g, b].sort

max_max_count = n / max
mid_max_count = n / mid

count = 0
max_count = max_max_count
while max_count >= 0 do
  mid_count = 0
  while mid_count <= mid_max_count do
    rest = n - max * max_count - mid * mid_count
    break if rest < 0
    count += 1 if rest % min == 0
    mid_count += 1
  end
  max_count -= 1
end

puts count
