input = gets.chomp.split
r = input[0].to_i
g = input[1].to_i
b = input[2].to_i
n = input[3].to_i

cnt = 0
sum = 0
for i in 0..n/r do
    sum = n
    sum -= r*i
    if sum == 0 
        cnt += 1
    else
        for j in 0..sum/g do
            sum2 = sum
            sum2 -= g*j
            if sum2 == 0 
                cnt += 1
            elsif sum2 % b == 0
                cnt += 1
            end
        end
    end
end

p cnt