Character count using ranges