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
for i in 0..(n/c) do
  for j in 0..(n/b) do
    for k in 0..(n/a) do
      sum = (a * k) + (b * j) + (c * i)
      if sum == n
        count += 1
      end
    end
  end
end

puts count
