How do I count the number of repeated characters in a string in Python