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

count = 0

sum = 0

0.upto(3000) do |index|
  0.upto(3000) do |index2|
    sum = r * index + g * index2
    if (n - sum) % b == 0 && n >= sum
      count += 1
    end
  end
end

puts count