#K36177. Maximum Beauty of a Subsequence

    ID: 25697 Type: Default 1000ms 256MiB

Maximum Beauty of a Subsequence

Maximum Beauty of a Subsequence

You are given a string s. The beauty of a subsequence is defined as the number of distinct characters it contains. Your task is to find the maximum beauty among all possible subsequences of s.

Note: A subsequence is a sequence that can be derived from the string by deleting some or no characters without changing the order of the remaining characters. In this problem, since the maximum beauty is achieved by taking all distinct characters, the answer is simply the number of distinct characters in the string.

For example, if s = "ababc", there are three distinct characters ({a, b, c}), so the maximum beauty is 3.

inputFormat

The input is read from stdin and is in the following format:

T
s1
s2
...
sT

Where T is the number of test cases and each si is a non-empty string.

outputFormat

For each test case, print a single integer on a new line representing the maximum beauty (i.e. the number of distinct characters) of the given string.

The output should be written to stdout.

## sample
5
ababc
abcd
a
zzzzz
aabbcc
3

4 1 1 3

</p>