r,g,b,n=gets.chomp.split(' ').map(&:to_i)
count=0
num=[r,g,b].sort.reverse
a1=n/num[0]
(a1+1).times do |i|
 a2=n-num[0]*i
  a3=a2/num[1]
  (a3+1).times do |j|
    a4=a2-num[1]*j
    if a4%num[2] == 0
      count+=1
    end
  end
end
puts count