[python] Counting repeated characters in a string in Python