#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[1000005];
while(scanf("%s", &s))
{
if(!strcmp(s, "."))
break;
int i, j, k, p, l = strlen(s);
int f;
p = i = j = k = 0;
for(i=1; i<=l; i++)
{
if(l%i == 0)
{
p = l/i;
f = 1;
for(j=0; j<i; j++)
{
for(k = j+i; k<l; k = k+i)
{
if(s[j] != s[k])
{
f = 0;
break;
}
}
}
if(f == 1)
break;
}
}
printf("%d\n", p);
}
return 0;
}
using namespace std;
int main()
{
char s[1000005];
while(scanf("%s", &s))
{
if(!strcmp(s, "."))
break;
int i, j, k, p, l = strlen(s);
int f;
p = i = j = k = 0;
for(i=1; i<=l; i++)
{
if(l%i == 0)
{
p = l/i;
f = 1;
for(j=0; j<i; j++)
{
for(k = j+i; k<l; k = k+i)
{
if(s[j] != s[k])
{
f = 0;
break;
}
}
}
if(f == 1)
break;
}
}
printf("%d\n", p);
}
return 0;
}
Comments
Post a Comment