s = input()
for i in range(len(s) - 1, -1, -1):
    if i % 2 == 0:
        m = i // 2
        if s[:m] == s[m:i]:
            print(i)
            exit()

336afb985373f7459c93b56f68804371740ed4a5
<mask token>

<mask token>
for i in range(len(s) - 1, -1, -1):
    if i % 2 == 0:
        m = i // 2
        if s[:m] == s[m:i]:
            print(i)
            exit()

s = input()
for i in range(len(s) - 1, -1, -1):
    if i % 2 == 0:
        m = i // 2
        if s[:m] == s[m:i]:
            print(i)
            exit()
