countingSubstrings task