Sottostringhe Distinte di una Stringa

Data una stringa s, l’obiettivo è di determinare quante siano le sue sottostringhe distinte. Due sottostringhe si considerano distinte se differiscono almeno in un carattere.

Input

L’unica riga di input contiene la stringa s (1 ≤ |s| ≤ 1000).

Output

Il programma deve stampare il numero di sottostringhe distinte di s.

Esempi

Input
Output
hello
14
habababohabo
62
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue