R,G,B,N = gets.chomp.split(" ").map(&:to_i)

max_r = N/R + 1
max_g = N/G + 1

count = 0
max_r.times do |i|
    max_g.times do |j|
        if ((N - R*i  - G*j) >= 0)
            if ((N - R*i  - G*j)%B == 0)
                count += 1
            end
        end
    end
end
puts count
