Period of the string#5443

Period of the string

0.5 seconds
64 megabytes
Medium (≈1350)

A string is said to have a period if \textbf{S} = \textbf{T}^n for some integer .

Given a string , your task is to determine the smallest possible length of such that \textbf{S} = \textbf{T}^n for some integer .

Input

The input consists of a single string , with a length ranging from to 10^6 characters.

Output

Output a single integer representing the length of .

Examples

Example 1

Loading
Loading