#include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
while(cin >> str, str != ".")
{
int len = str.size();
for(int n = len; n ; n --) //n是指最小子串重复的次数
{
if(len % n == 0)
{
int m = len / n; //m是最小字串的位数
string s = str.substr(0,m); //最小字串
string r;
for(int i = 0; i < n; i ++ )
r += s; //将最小字串重复n次与str进行对比
if(r == str)
{
cout << n << endl;
break;
}
}
}
}
return 0;
}