Distinct Substrings
How many different non-empty substrings does the string have? (aba has a, b, ab, ba, aba → 5.)
Input
One string of lowercase letters.
Output
The number of distinct substrings.
Constraints
1 to 300 letters.
Sample 1
Input
aba
Output
5
Sample 2
Input
aaa
Output
3