#c22302. 最小循环覆盖

最小循环覆盖

Minimum Cyclic Cover (String)

Problem Description

You are given a string aa, and you need to find the length of the minimum cyclic cover of this string.

bb is the minimum cyclic cover of aa if and only if aa is a prefix of the string obtained by concatenating multiple copies of bb, and bb is the shortest string satisfying this condition.

Given a string aa, output a number: the length of the minimum cyclic cover bb.

Input Format

One line containing a string aa.

Output Format

Output one line containing a number: the answer.

Sample Input 1

bcabcabcabcab

Sample Output 1

3

Sample Input 2

aaaaaaa

Sample Output 2

1

Constraints

For all data, 1≤∣a∣≤1051 \leq |a| \leq 10^5, and the string consists of lowercase letters only.