r,g,b,n = $stdin.read.split(" ").map(&:to_i)
 
result = 0
 
(n+1).times do |i|
  (n+1).times do |j|
    ko = i * r + j * g
      if ko > n
        break
    elsif (n - ko) % b == 0
        result +=1
    end    
          
  end
end
 
puts result