corrected way of counting strings