#C2933. Character Frequency Count

    ID: 46304 Type: Default 1000ms 256MiB

Character Frequency Count

Character Frequency Count

You are given a string S that may include letters, digits, spaces, and special characters. Your task is to count the frequency of each character in S after removing all characters that are not English letters or digits.

Formally, let \( S' \) be the string obtained after filtering out any character \( c \) for which \( c \notin [a-zA-Z0-9] \). You need to compute a mapping where each key is a unique character from \( S' \) and the corresponding value is the number of times that character appears in \( S' \).

Note: The counting is case-sensitive. For example, 'A' and 'a' are considered different characters.

inputFormat

The input consists of a single line containing a string S. The string may include spaces and special characters.

outputFormat

Output a JSON object (in one line) representing the frequency counts of each valid character in the filtered string. The JSON object should have keys as characters and values as their counts. The format should be exactly as shown in the examples. For instance, an output might look like: {"H":1,"e":1,"l":3,"o":2}.

## sample
Hello World!
{"H":1,"e":1,"l":3,"o":2,"W":1,"r":1,"d":1}