*a, n = gets.chomp.split(" ").map(&:to_i)
a = a.sort.reverse
cnt = 0

max_0 = n / a[0]
0.upto(max_0) do |r|
  rest1 = n - r * a[0]
  max_1 = rest1 / a[1]
  0.upto(max_1) do |g|
    rest2 = rest1 - g * a[1]
    cnt += 1 if rest2 % a[2] == 0
  end
end

puts cnt
