determining how many repetitions string has done.