# coding: utf-8

# Your code here!

from collections import Counter



S = list(eval(input()))

A_li = []

B_li = []



for i in range(1, len(S) + 1):

    S_del = S[:-i]

    A_li = S_del[0:len(S_del) // 2]

    B_li = S_del[len(S_del) // 2::]

    if A_li == B_li:

        print((len(A_li) * 2))

        exit()
# coding: utf-8

# Your code here!



S = list(eval(input()))

A_li = []

B_li = []



for i in range(1, len(S) + 1):

    S_del = S[:-i]

    A_li = S_del[0:len(S_del) // 2]

    B_li = S_del[len(S_del) // 2::]

    if A_li == B_li:

        print((len(A_li) * 2))

        exit()
# coding: utf-8
# Your code here!
from collections import Counter

S = list(eval(input()))
A_li = []
B_li = []
for i in range(1, len(S) + 1):
    S_del = S[:-i]
    A_li = S_del[0 : len(S_del) // 2]
    B_li = S_del[len(S_del) // 2 : :]
    if A_li == B_li:
        print((len(A_li) * 2))
        exit()

# coding: utf-8
# Your code here!
S = list(eval(input()))
A_li = []
B_li = []
for i in range(1, len(S) + 1):
    S_del = S[:-i]
    A_li = S_del[0 : len(S_del) // 2]
    B_li = S_del[len(S_del) // 2 : :]
    if A_li == B_li:
        print((len(A_li) * 2))
        exit()

-from collections import Counter -