r, g, b, n = gets.split.map(&:to_i)
max_r = ((n + r - 1) / r).to_i
max_g = ((n + g - 1) / g).to_i
max_b = ((n + b - 1) / b).to_i

ans = 0
count = 0
for i in 0..max_r
  for j in 0..max_g
    for k in 0..max_b
      v = i * r + j * g + k * b
      ans += 1 if v == n
      break if v > n
    end
  end
end

puts ans
