#! -*- coding:utf-8 -*-
s = str(input())
s = list(s)
#print(s)
a = 'x'
b = 'x'

for i in range(len(s)):
    s.pop()
    if len(s) % 2 == 0:
        a = s[:len(s)//2]
        b = s[len(s)//2:]
        if a == b:
            print(len(s))
            break

bdc858667c6e77b857233ee53c708b56c4fcd79b
<mask token>

<mask token>
for i in range(len(s)):
    s.pop()
    if len(s) % 2 == 0:
        a = s[:len(s) // 2]
        b = s[len(s) // 2:]
        if a == b:
            print(len(s))
            break

s = str(input())
s = list(s)
a = 'x'
b = 'x'
for i in range(len(s)):
    s.pop()
    if len(s) % 2 == 0:
        a = s[:len(s) // 2]
        b = s[len(s) // 2:]
        if a == b:
            print(len(s))
            break

#! -*- coding:utf-8 -*-
s = str(input())
s = list(s)
#print(s)
a = 'x'
b = 'x'

for i in range(len(s)):
    s.pop()
    if len(s) % 2 == 0:
        a = s[:len(s)//2]
        b = s[len(s)//2:]
        if a == b:
            print(len(s))
            break
