| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 64 MB | 99 | 54 | 40 | 48.780% |
A pair of strings form an anagram if the first of them can be transformed into the second by a permutation of letters. For example, "listen" and "silent" form an anagram, but "master" and "nearest" do not.
A subsequence of string $s = s_1 s_2 \dots s_n$ is a string $s_{a_1} s_{a_2} \dots s_{a_k}$, where $1 \le a_1 < a_2 < \dots < a_k \le n$.
Given string $s$, determine the maximal number of its subsequences which can be written down such that no pair of strings in the resulting list does form an anagram.
A single line containing string $s$ of at most $60$ small latin letters.
Print one number --- the answer.
jojo
8
uralchampionship
20735
In the first sample the resulting list of strings may be: "j", "o", "jj", "jo", "oo", "jjo", "joo", "jojo".