input=gets.chomp.split()
a=input[0].to_i
b=input[1].to_i
c=input[2].to_i
n=input[3].to_i

count=0
sum=0

i = n / c

while i >= 0
  j = (n - (c * i)) / b
  while j >= 0
    k = (n - (c * i) - (b * j)) / a
    sum = (c * i) + (b * j) + (a * k)
    if sum == n
      count += 1
    end
    j -= 1
  end
  i -= 1
end

puts count
