Optimized bitcounts