def valid?(current, stride, n)
  return false if current > n
  diff = n - current
  diff % stride == 0
end

r, g, b, n = gets.split.map(&:to_i)
nums = [r, g, b]
nums.sort.reverse
maxes = nums.map do |num|
  ((n + num - 1) / num).to_i
end

ans = 0
count = 0
for i in 0..maxes[0]
  for j in 0..maxes[1]
    current = i * nums[0] + j * nums[1]
    if valid?(current, nums[2], n)
      ans += 1
    end
  end
end

puts ans
