Counting strings