Frequency counting for zero-range alphabets.