R,G,B,N = (gets).split(" ").map { |i| i.to_i }

count = 0

N.div(R).downto(0) do |r|
  (N-R*r).div(G).downto(0) do |g|
    b,m = (N-(R*r+G*g)).divmod(B)
    if (b >= 0) && (m == 0) then
        #puts "(#{r}, #{g}, #{b})"
        count += 1
    end
  end
end

puts count
