Stringhe ripetute distinte

Dato un testo t, devi determinare quante sottostringhe uniche e non vuote si ripetono all’interno di t. Una stringa si considera ripetuta se può essere ottenuta concatenando la stessa sottostringa s a se stessa → s + s.

Input

La prima riga dell’input contiene il testo t (1 ≤ |t| ≤ 1000).

Output

Il programma deve stampare il numero di stringhe ripetute presenti in t.

Esempi

Ingresso
Uscita
yeeey
1
abcabcabc
3

Spiegazione

  1. yeeey → ee
  1. abcabcabc → abcabc, bcabca, cabcab
 

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