#K72257. Counting Characters Occurring Exactly Twice

    ID: 33713 Type: Default 1000ms 256MiB

Counting Characters Occurring Exactly Twice

Counting Characters Occurring Exactly Twice

You are given a string (s). Your task is to count the number of distinct characters in (s) that occur exactly twice.

For example, if (s = 'aabbcde'), the output should be (2).

Your solution should read the input from standard input (stdin) and print the result to standard output (stdout).

inputFormat

A single line containing the string (s). The string may include letters, digits, and symbols. Input is read from stdin.

outputFormat

Print a single integer representing the number of distinct characters that appear exactly twice in the string. Output is written to stdout.## sample

aabbcde
2