S = input().strip()

N = len(S)

for i in range(2,N,2):

    x = S[:-i]

    y = x[:(N-i)//2]

    z = x[(N-i)//2:]

    if y==z:

        print((N-i))

        break
S = input().strip()

N = len(S)

for i in range(N//2-1,0,-1):

    if S[:i]==S[i:2*i]:

        ans = i

        break

print((ans*2))
S = input().strip()
N = len(S)
for i in range(2, N, 2):
    x = S[:-i]
    y = x[: (N - i) // 2]
    z = x[(N - i) // 2 :]
    if y == z:
        print((N - i))
        break

S = input().strip()
N = len(S)
for i in range(N // 2 - 1, 0, -1):
    if S[:i] == S[i : 2 * i]:
        ans = i
        break
print((ans * 2))

-for i in range(2, N, 2): -    x = S[:-i] -    y = x[: (N - i) // 2] -    z = x[(N - i) // 2 :] -    if y == z: -        print((N - i)) +for i in range(N // 2 - 1, 0, -1): +    if S[:i] == S[i : 2 * i]: +        ans = i +print((ans * 2))