#Lutece1703. 一道更简单的字符串题

一道更简单的字符串题

Migrated from Lutece 1703 一道更简单的字符串题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

有一天,潘爷在白纸上写了字符串A,然后他不断的重复写这个字符串A,于是白纸上出现了一个新的字符串:AAAAAAAA....。现在我从这个字符串的两个不同的位置截取了一段字符串叫做B,现在给你这个字符串B,你能告诉我潘爷可能写的最短的字符串A有多长吗。举个例子,A=“abcdefg”,我获得的字符串是 abcd efgabcdefgabcde fgabcdefg..... ,现在我把红色的部分“efgabcdefgabcde”作为B,你需要找到最短的符合条件的字符串A的长度。

Input

输入包括一个字符串B,长度不大于1000000;

Output

对于每组数据,输出一个整数,代表最短的字符串A的长度。

Samples

efgabcdefgabcde
7

Resources

2017 UESTC Training for Search Algorithm & String