#C4002. Counting Frequencies of Numbers

    ID: 47493 Type: Default 1000ms 256MiB

Counting Frequencies of Numbers

Counting Frequencies of Numbers

You are given a single line string containing a list of integers separated by commas and spaces. Your task is to count the frequency of occurrence of each integer and print each integer along with its frequency.

The output should list each key (integer) and its frequency in ascending order of keys. Each line of the output should be in the format: key: value.

For example, if the input string is "1, 2, 2, 3, 3, 3, 4, 4, 4, 4", the output should be:

1: 1
2: 2
3: 3
4: 4

Note: Ensure that your solution reads from standard input (stdin) and writes to standard output (stdout).

The frequency calculation can be mathematically represented as follows:

$$ f(n) = \text{number of times } n \text{ appears in the list} $$

inputFormat

The input is a single line string containing a list of integers separated by commas and spaces.

For example: "1, 2, 2, 3, 3, 3, 4, 4, 4, 4"

outputFormat

The output consists of multiple lines. Each line should contain an integer and its frequency in the format: "key: value". The lines should be ordered in ascending order of the integer keys.

## sample
1, 2, 2, 3, 3, 3, 4, 4, 4, 4
1: 1

2: 2 3: 3 4: 4

</p>