Simplified count implementation.