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

numbers = []

numbers.push(r)
numbers.push(g)
numbers.push(b)

numbers.sort!

number_0_max = n / numbers[0] + 1
number_1_max = n / numbers[1] + 1
number_2_max = n / numbers[2] + 1

count = 0

sum0 = 0
sum1 = 0
sum2 = 0

number_0_max.downto(0) do |index|
  sum0 = numbers[0] * index
  if sum0 > n
    next
  elsif sum0 == n
    count += 1
    next
  else
    number_1_max = (n - sum0) / numbers[1] + 1
  end
  number_1_max.downto(0) do |index2|
    sum1 = numbers[1] * index2
    if sum0 + sum1 > n
      next
    elsif sum0 + sum1 == n
      count += 1
      next
    else
      number_2_max = (n - sum0 - sum1) / numbers[2] + 1
    end
    number_2_max.downto(0) do |index3|
      sum2 = numbers[2] * index3
      if sum0 + sum1 + sum2 > n
        next
      elsif sum0 + sum1 + sum2 == n
        count += 1
        break
      else
        break
      end
    end
  end
end

puts count