box = Array.new(3)
box[0], box[1], box[2], n = gets.split.map(&:to_i)
count = 0
box.sort.reverse!


for i in 0..(n/box[0])
  for j in 0..((n-box[0]*i)/box[1])
    count += 1 if (n - box[0]*i - box[1]*j) % box[2] == 0
  end
end

puts count