c = []
c[0], c[1], c[2], n = gets.split.map(&:to_i)
c.sort!.reverse!
res = 0
for i in 0..(n / c[0]) do
  rn = c[0] * i
  for j in 0..((n - rn) / c[1]) do
    gn = c[1] * j
    if (n - rn -gn) % c[2] == 0
      res += 1
    end
  end
end
puts res
