Use len() instead of a counter.