while True:
s = input()
if s == '.':
break
n = len(s)
for i in range(1,n + 1):
if n % i == 0:
t = ""
for j in range(n // i):
t += s[:i]
if t == s:
print(n // i)
break