Circular Shift

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Vasya was at a meeting during his working day at Yandex. Suddenly he thought about a string ss consisting of lowercase English letters.

Then he decided that a string t=t_1t_2t_mt = t\_{1} t\_{2} \dots t\_{m} (m>0m > 0) is called a good string with respect to ss if tt is a substring of ss and the left circular shift t=t_2t_mt_1t' = t\_{2} \dots t\_{m} t\_{1} of string tt is also a substring of ss.

Vasya was going to calculate the number of different good strings tt with respect to the given string ss...~but suddenly a colleague asked him a question, so he had to return back to reality. Find that number for Vasya while he is busy with the meeting.

입력

The only input line contains a string ss consisting of nn (1n300,0001 \leq n \leq 300\\,000) lowercase English letters.

출력

Output a single integer: the number of different good strings tt with respect to the given string ss.

힌트

In the first sample case, the good strings are exactly the following strings: a, b, c, aa, ab, ba, aba.

In the second sample case, the good strings are exactly the following strings: a, aa, aaa.