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

c=0
rmax=(N/R).floor
(0..rmax).each do |r|
    gmax=((N-r*R)/G).floor
    (0..gmax).each do |g|
        nokori=N-r*R-g*G
        if nokori%B==0
            c+=1
        end
    end
end


puts c
