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

numbers = []

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

numbers.sort!

count = 0

number_0_max = n / numbers[0]
number_1_max = n / numbers[1]
sum = 0

3001.times do |index|
  3001.times do |index2|
    sum = numbers[0] * index + numbers[1] * index2
    if (n - sum) % numbers[2] == 0 && n >= sum
      count += 1
    end
  end
end

puts count