#C14529. Letter Frequency Counter

    ID: 44188 Type: Default 1000ms 256MiB

Letter Frequency Counter

Letter Frequency Counter

This problem requires you to compute the frequency of each alphabet letter in a given string. The counting should be case-insensitive and ignore any characters which are not letters. More formally, given an input string \(S\), you must produce a dictionary \(D\) such that for every letter \(c\) (\(a \leq c \leq z\)) that appears in \(S\) (ignoring case), its value in \(D\) equals the number of times it appears in \(S\).

The letters in the produced dictionary should appear in the order of their first occurrence in the input string. For example, for the input Hello, World!, the first letter (ignoring case) is \(h\) appearing once, followed by \(e\) once, then \(l\) three times etc. Your solution must read input from stdin and output the result to stdout in the specified dictionary format.

Note: The dictionary should be printed in the Python literal format with single quotes, e.g., {'a': 2, 'b': 3}.

inputFormat

The input consists of a single line string (which may contain spaces, punctuation, numbers, etc.) read from stdin.

outputFormat

Output a dictionary (in Python literal format) representing the frequency count of each letter (in lowercase), ignoring non-letter characters. The keys in the dictionary should appear in the order of their first occurrence in the input string.## sample

Hello, World!
{'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}