#K9821. Count Unique Words

    ID: 39115 Type: Default 1000ms 256MiB

Count Unique Words

Count Unique Words

You are given a text string. Your task is to count the number of unique words in the text. A unique word is defined as a word that appears exactly once in the text. The comparison should be case-insensitive, meaning that 'Word' and 'word' are considered the same word.

For simplicity, the input text will be provided as a single string and words can be assumed to be separated by whitespace. Punctuation is considered part of a word.

Note: If the text contains no words, the output should be 0.

Formally, given a string \( S \), let \( W \) be the multiset of words obtained by splitting \( S \) by whitespace and converting all letters to lower case. You are required to compute:

[ \text{result} = |{ w \in W : \text{count}(w)=1 }|. ]

inputFormat

The input consists of a single line representing the text string. The text may contain spaces, punctuation, and may be empty.

outputFormat

Output a single integer which is the count of unique words that appear exactly once in the input text. The output should be followed by a newline.

## sample
I love coding and I love learning.
3