""" 
a b a b a b a b a b a b 
12 0 10 0 8 ... 

......
  ......

ababab
6 0 4 0 2 0
6 5 4 3 2 1 
"""   

def z(s):
    n = len(s)
    z = [0] * n
    l,r = 0,0
    for i in range(1,n):
        if i <= r:
            z[i] = min(r-i+1,z[i-1])
        while (i + z[i] < n and s[z[i]] == s[i + z[i]]):
            z[i] += 1
        if (i + z[i] - 1 > r):
            l = i
            r = i + z[i] - 1
    return z

inp = input()
while inp != ".":
    inp
    zt = z(inp)
    i = 0
    n = len(inp)
    while i <= n-1 and zt[i] < n-i:
        i+=1
    if (n%i == 0):
        print(n//i)
    else: 
        print(1)
    inp = input()

