#P1972. Distinct Shell Types
Distinct Shell Types
Distinct Shell Types
HH has a necklace made of various beautiful shells. After each walk, he randomly picks a segment of the necklace to ponder its meaning. Given that HH constantly collects new shells, his necklace grows endlessly long.
One day, HH wonders: How many distinct types of shells are there in a chosen segment?
This can be formulated mathematically as follows: given a string \( s \) representing a segment of shells, compute \[ distinct = \left|\{ c \mid c \in s \}\right| \] where \(|\cdot|\) denotes the cardinality (the number of elements) of the set.
inputFormat
The input consists of a single non-empty line containing a string s
representing a segment of shells. Each character of the string corresponds to a type of shell.
outputFormat
Output a single integer: the number of different shell types present in the string.
sample
abc
3
</p>