Count the number of distinct substrings that appear in a string.
The only input line has a string of length $n$ that consists of characters a–z.
Print one integer: the number of substrings.
abaa
\n
8
\n
the substrings are a , b , aa , ab , ba , aba , baa and abaa .