#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+1e4,M=1e3+1e2;
const ll Maxn=0x3ffffff,Minm=-0x3ffffff;
char s[N];
signed main()
{
cin>>s;
while(s[0]!='.')
{
ll n=strlen(s);
for(ll i=0;i<n;i++)
{
bool flag=true;
ll xb=0;
for(ll j=i+1;j<n;j++)
{
if(s[j]!=s[xb])
{
flag=false;
break;
}
xb++;
if(xb>i)xb=0;
}
if(flag==true&&n%(i+1)==0)
{
cout<<n/(i+1)<<"\n";
break;
}
}
cin>>s;
}
}