#C8602. Counting Alphabetical Characters

    ID: 52603 Type: Default 1000ms 256MiB

Counting Alphabetical Characters

Counting Alphabetical Characters

You are given a string s. Your task is to count the frequency of each alphabetical character in s, ignoring the case of the letters. That is, treat uppercase and lowercase letters as the same, and only count characters for which isalpha() (or its equivalent) is true.

You should then output the result as a dictionary literal. The dictionary must have all keys in lowercase and sorted in lexicographical order. For instance, for input Hello, World!, the output should be formatted as {'d': 1, 'e': 1, 'h': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1}.

All formulas or conditions, if mentioned, must use LaTeX formatting. For example, to denote the condition of being an alphabetical character, you might use $\text{isalpha}(c)$.

inputFormat

The input consists of a single line containing the string s. The string may be empty and can include spaces, punctuation, digits, or other symbols.

outputFormat

Output a dictionary literal representing the count of each alphabetical character occurring in s. The keys must be in lowercase and sorted in lexicographical order. The format must strictly follow the Python dictionary literal style. For example, if s = 'aaaaBBBccc', then the output should be:

{'a': 4, 'b': 3, 'c': 3}
## sample
Hello, World!
{'d': 1, 'e': 1, 'h': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1}