Count optimization