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

m = [r, g, b].sort

i = 0
j = 0
k = 0

c = 0

r0 = n - i * m[0]

loop do 
  j = 0
  g0 = r0 - j * m[1]
  loop do
    if g0 % m[2] == 0
      c += 1
    end

    j += 1
    g0 = r0 - j * m[1]
    break if g0 < 0
  end

  i += 1
  r0 = n - i * m[0]
  break if r0 < 0
end

puts c