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

box = {
    "R" => R,
    "G" => G,
    "B" => B,
}.sort {|(_, v1), (_, v2)| v2 <=> v1 }.to_h

max_r = N / R
max_g = N / G
max_b = N / B

# Rをr個選んだとき
memo = []
0.upto(max_r) do |i|
    memo[i] = [i, N - i * R]
end

memo2 = []
count = 0

0.upto(max_g) do |i|
    memo.each do |m|
        x = m[1] - i * G
        if x >= 0 && x % B == 0
            #memo2.push([memo[0][0], i, x])
            count += 1
            #puts "#{memo[0][0]},#{i}"
        end
    end
end

puts count

#require 'pp'
#pp memo2.count

