finds the no of repetitions for a string in a list