Optimized message count