r, g, b, n = gets.chomp.split.map(&:to_i)
c = [r, g, b].sort.reverse
cnt = 0
for i in 0..(n/c[0])
  for j in 0..((n-i*c[0])/c[1])
    if ((n-i*c[0])-j*c[1]) % c[2] == 0
      cnt += 1
    end
  end
end
puts cnt
