s = input()[:-1]

for i in range(len(s)):

    x = s[:i]

    n = len(s[:i])

    if n%2==0 and x[:i//2]==x[i//2:]:

        ans = n

print(ans)
s = input()[:-1]



while s[:len(s)//2]*2 != s:

    s = s[:-1]



print((len(s)))
s = input()[:-1]
for i in range(len(s)):
    x = s[:i]
    n = len(s[:i])
    if n % 2 == 0 and x[: i // 2] == x[i // 2 :]:
        ans = n
print(ans)

s = input()[:-1]
while s[: len(s) // 2] * 2 != s:
    s = s[:-1]
print((len(s)))

-for i in range(len(s)): -    x = s[:i] -    n = len(s[:i]) -    if n % 2 == 0 and x[: i // 2] == x[i // 2 :]: -        ans = n -print(ans) +while s[: len(s) // 2] * 2 != s: +    s = s[:-1] +print((len(s)))