r,g,b,n = gets.split.map(&:to_i)
ans = 0
rr = n/r
gg = n/g
bb = n/b
(0..rr).each do |rrr|
  (0..gg).each do |ggg|
    next if rrr * r + ggg * g > n
    if (n - (rrr * r + ggg * g)) / b <= bb && (n - (rrr * r + ggg * g)) % b == 0
      # puts "#{rrr} #{ggg}"
      ans += 1
    end
    # (0..bb).each do |bbb|
    #   if rrr * r + ggg * g + bbb * b == n
    #     ans += 1
    #   end
    # end
  end
end
puts ans