a,b,c,n = gets.split(' ').map(&:to_i)
counter = 0
(0..n / a).each do |a_num|
  (0..n / b).each do |b_num|
    c_num = (n - a * a_num - b * b_num) * 1.0 / c
    counter += 1 if c_num >= 0 && (c_num - c_num.to_i) < 0.00001
  end
end
puts counter
