Another easy string problem#11545

Another easy string problem

2 segundos
256 megabytes
Muy difícil (≈2050)

Given a string . We call any non-empty string good, if it is a substring of and has 4 non-overlapping occurrences in . Your task is to find the number of different good strings.

Entrada

Contains one string s~(1 \le \textit{length of s} \le 10^5) — given string. It is guaranteed that all characters are lowercase English letters.

Salida

Print one integer — the number of different good strings.

Ejemplos

Ejemplo 1

Loading
Loading

Ejemplo 2

Loading
Loading