Problem:
 Score : 200 points    Problem Statement We will call a string that can be obtained by concatenating two equal strings an even string.
For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.  You are given an even string S consisting of lowercase English letters.
Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S .
It is guaranteed that such a non-empty string exists for a given input.      Constraints  2 \leq |S| \leq 200  S is an even string consisting of lowercase English letters.  There exists a non-empty even string that can be obtained by deleting one or more characters from the end of S .         Input Input is given from Standard Input in the following format:  S       Output Print the length of the longest even string that can be obtained.        Sample Input 1 abaababaab      Sample Output 1 6   abaababaab itself is even, but we need to delete at least one character.  abaababaa is not even.  abaababa is not even.  abaabab is not even.  abaaba is even. Thus, we should print its length, 6 .        Sample Input 2 xxxx      Sample Output 2 2   xxx is not even.  xx is even.        Sample Input 3 abcabcabcabc      Sample Output 3 6  The longest even string that can be obtained is abcabc , whose length is 6 .       Sample Input 4 akasakaakasakasakaakas      Sample Output 4 14  The longest even string that can be obtained is akasakaakasaka , whose length is 14 .

Solution (Python):
s = input()
n = len(s)
for i in range(n // 2):
  t = s[:n - 2 * (i + 1)]
  m = len(t) // 2
  if t[:m] == t[m:]:
    print(len(t))
    exit()

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

S = s()
N = len(S)
ans = 0
for i in range(1,N-1,2):
    a = S[:i+1]
    if a[:(i+1)//2] == a[(i+1)//2:]:
        ans = i+1
print(ans)

Solution (Python):
import sys
S = input()
while True:
    S = S[:-2]
    l = len(S)
    if S[:l // 2] == S[l // 2:]:
        print(l)
        sys.exit()

Solution (Python):
import sys
sys.setrecursionlimit(500000)

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    S = input()
    N = len(S)//2
    for i in range(1, N+1):
        t = S[:2*N-2*i]
        n = len(t)//2
        if t[:n] == t[n:]:
            print(2*n)
            return

if __name__ == '__main__':
    main()

Solution (Python):
s = open(0).read().rstrip()
 
if len(s)%2:
    s = s[:-1]
else:
    s = s[:-2]
 
while s[:len(s)//2] != s[len(s)//2:]:
    s = s[:-2]
 
print(len(s))

Solution (Python):
S = input()
n = len(S)
n = n - 2 if n % 2 == 0 else n - 1
ans = -1
for i in range(n - 1, -1, -2):
    T = S[: i + 1]
    l = (i + 1) // 2
    if T[: l] == T[l:]:
        ans = i + 1
        break
print(ans)

Solution (Python):
s = input()

while len(s) > 2:
    s = s[:-2]
    n = len(s) // 2
    if s[:n] == s[n:]:
        print(len(s))
        exit(0)
print(1)

Solution (Python):
s = input()

if len(s) == 2:
    print(1)
else:
    while len(s) > 2:
        s = s[:-2]
        n = len(s) // 2
        if s[:n] == s[n:]:
            print(len(s))
            exit(0)
    print(1)

Solution (Python):
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(a,b):
    if a == b:
        return True
    return False
if __name__ == "__main__":
    s = L()
    for i in range(1,len(s)-1):
        a = s[:len(s)-i]
        n = len(a)
        
        if (f(a[:n//2],a[n//2:])):
            print(n)
            break

Solution (Python):


S = list(str(input()))

while len(S) > 1:
    S.pop()
    if S[0 : len(S) // 2] == S[len(S) // 2 :] and len(S) % 2 == 0:
        print(len(S))
        exit()

Solution (Python):
a=input()
b=0
c=len(a)//2
for i in range(c-1):
    if a[0:i]==a[i+1:i+1+i]:
        b=i+1
print(b*2)

Solution (Python):
s = input()

ans = 0
n = len(s) // 2

for i in range(n-1):
    if s[0 : i] == s[i+1 : i+1 + i]:
        ans = i + 1

print(ans * 2)

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

Solution (Python):




import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy











S=input()

if len(S)%2==1:
    S = S[:-1]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        sys.exit()

for i in range(len(S)//2):
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        sys.exit()

Solution (Python):
S = list(input())
num = len(S)
for i in range(num):
    S.pop()
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break

Solution (Python):

S = str(input())
N = len(S)

for i in range(1,N+1):
    T = S[0:-i]
    M = N-i
    if M % 2 == 1:
        pass
    elif T[0:(M//2)] != T[(M//2):M]:
        pass
    else:
        print(N-i)
        break

Solution (Python):
def main():
    s = list(input())
    
    for i in range(1,len(s)//2):
        t=s[:-2*i]
        half=len(t)//2
        if t[:half]==t[half:]:
            print(len(t))
            break

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

Solution (Python):
s=input()
for i in range(1,len(s)//2):
  t=s[:-2*i]
  half=len(t)//2
  if t[:half]==t[half:]:
    print(len(t))
    break

Solution (Python):
s = list(input())

while True:
  s.pop()
  s.pop()
  t = len(s)//2
  if s[:t]==s[t:]:
    print(len(s))
    exit()

Solution (Python):
s=list(input())
while len(s)!=0:
  s.pop(len(s)-1)
  if s[:len(s)//2]*2==s:
    break
print(len(s))

Solution (Python):
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

s = input()
if len(s)%2==1:
  s = s[:-1]
else:
  s = s[:-2]
while 1:
  if s[:len(s)//2]==s[len(s)//2:]:
    print(len(s))
    exit()
  else:
    s = s[:-2]

Solution (Python):
s=input()

if len(s)%2:
  s=s[:-1]
else:
  s=s[:-2]

while len(s)!=2:
  if s[:len(s)//2]==s[len(s)//2:]:
    break
  s=s[:-2]
print(len(s))

Solution (Python):
A= list(input())
while True:
    A.pop()
    A.pop()
    B=len(A)//2
    if A[:B]==A[B:]:
        print(len(A))
        break

Solution (Python):
import sys
import math
s = list(input())
for i in range(len(s)):
	s.pop()
	n = math.ceil(len(s)/2)
	if s[:n] == s[n:]:
		print(len(s))
		sys.exit()

Solution (Python):
import sys
import math
s = list(input())
for i in range(len(s)):
	s.pop()
	n = math.ceil(len(s)/2)
	if s[:n] == s[n:]:
		print(len(s))
		sys.exit()

Solution (Python):
S = list(input())
N = len(S) // 2
for i in range(1, N):
  A = S[:(N-i)]
  B = S[N-i:2 * (N-i)]
  if A == B:
    ans = 2 * (N-i)
    break
print(ans)

Solution (Python):
s = input()
n = len(s)
for i in range(1,n):
  if (n-i)%2==0:
    if s[:(n-i)//2] == s[(n-i)//2:n-i]:
      print(n-i) 
      break

Solution (Python):
import sys
S = str(input())

if len(S) < 2 or len(S) > 200:
    sys.exit()
if not S.islower():
    sys.exit()

result = 0
for I in range(len(S)):
    length = len(S) - I
    if (not I == 0) and length % 2 == 0 and S[0:int(length / 2)] == S[int(length / 2):length]:
        print(length)
        sys.exit()

Solution (Python):
s=input()
l=len(s)
for i in range(1,l//2):
    k=(l-i*2)
    if s[:k//2]==s[k//2:k]:
        print(k)
        break

Solution (Python):
S=input()
while True:
  S=S[:-1]
  if len(S)%2==0:
    M=len(S)//2
    if S[:M]==S[M:]:
      break
print(len(S))

Solution (Python):
def resolve():
    S = input()
    for i in range(len(S) - 2, 0, -2):
        if S[0:i // 2] == S[i // 2:i]:
            print(i)
            return


resolve()

Solution (Python):
S = input()[:-1]

while S[:len(S)//2]!=S[len(S)//2:]:
  S = S[:-1]

print(len(S))

Solution (Python):









import os
import sys




def main():
    s = input()
    while s:
        s = s[:-1]
        if len(s)%2!=0:
            continue
        mid = len(s)//2
        left = s[:mid]
        right = s[mid:]
        if left==right:
            print(len(s))
            return

    


if __name__ == "__main__":
    main()

Solution (Python):
def main():
  s = input()
  if len(s)%2==0:
    s=s[:len(s)-2]
  else:
    s=s[:len(s)-1]
  while True:
    if(s[0:int(len(s)/2)]==s[int(len(s)/2):len(s)]):
      print(len(s))
      break
    s=s[:len(s)-2]

main()

Solution (Python):
S = list(input())
for i in range(len(S)//2):
    flag =0
    _ = S.pop(-1)
    _ = S.pop(-1)
    bf = S[:len(S)//2]
    af = S[len(S)//2:]
    for i in range(len(bf)):
        if bf[i] != af[i]:
            flag = 1
            break
    if flag ==0:
        break
print(len(S))

Solution (Python):
S = input()

for i in range(1, len(S)):
    s = S[:-i]
    n = len(s)

    if n % 2 == 0 and s[:n // 2] == s[-n // 2:]:
        print(n)
        break

Solution (Python):
s=list(input())
from copy import copy
t=s.copy()

for i in range(len(t)):
  p=int(len(s)/2)
  if len(s)%2==0 and s[:p]==s[p:] and len(s)!=len(t):
    print(len(s))
    exit()
  else:
    s.pop(-1)

Solution (Python):
s=input()
f=False
sl=len(s)
while not f:
    sl-=2
    if s[0:sl//2]==s[(sl+1)//2:sl]:
        f=True
print(sl)

Solution (Python):
S = list(input())

length = len(S)
S.pop()
for _ in range(length):
    if len(S) % 2 != 0:
        S.pop()
        continue

    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break

    else:
        S.pop()

Solution (Python):
def main():
    S = input()
    N = len(S)
    for i in range(1,N//2):
        if S[:N//2-i] == S[N//2-i:N-i*2] :
            print(N-i*2)
            return
main()

Solution (Python):
s = input()

f = False
sl = len(s)
while f == False:
    sl -= 2
    if s[0:sl//2] == s[(sl+1)//2:sl]:
        f = True

print(sl)

Solution (Python):
S = input()
for i in range(len(S)):
    S = S[0:-2]
    if len(S)%2==0 and S[0:len(S)//2] == S[len(S)//2:]:
            print(len(S))
            break

Solution (Python):
s = str(input())
i = 2
while True:
    s = s[:len(s)-2]
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break
    i += 2

Solution (Python):
S = input()
s=[]
for i in S:
    s.append(i)
for i in range(len(s)):
  t = s[0:-i-1]
  if t[:len(t)//2]==t[len(t)//2:]:
    print(len(t))
    break

Solution (Python):
S = list(input())

while S != []:
    S.pop()
    S.pop()
    l = len(S)
    half = int(l / 2)
    
    
    
    if S[0:half] == S[half:]:
        print(l)
        exit()

Solution (Python):
s = input()

lens = len(s)
if len(s)%2 == 1:
    s = s[0:-1]
else:
    s = s[0:-2]
for i in range(lens):
    half = int(len(s)/2)
    if s[0:half] == s[half:half*2]:
        print(half*2)
        break
    else:
        s = s[0:-2]

Solution (Python):
s=input()
while 1:
    s=s[:-2]
    if s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        exit()

Solution (Python):
def readinput():
    s=input()
    return s

def main(s):
    i=len(s)-2
    while(i>0):
        lensub=i//2
        sub1=s[:lensub]
        sub2=s[lensub:lensub*2]
        if sub1==sub2:
            return i
        i-=2
    return 0

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)

Solution (Python):
s = input()
t = len(s)
for i in range(1,t+1):
    if (t-i)%2 == 1:
        continue
    else:
        if s[:(t-i)//2] == s[(t-i)//2:t-i]:
            print(len(s)-i)
            break

Solution (Python):
s=input()
s=s[:-1]
while True:
  if len(s)%2==0 and s[len(s)//2:]==s[:len(s)//2]:
    print(len(s))
    break
  else:
    s=s[:-1]
    continue

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
n = len(s)
ans = 0
for i in range(1, n+1):
    temp_s = s[0:n-i]
    temp_n = len(temp_s)
    if temp_s[0:temp_n//2] == temp_s[temp_n//2:]:
        ans = temp_n
        break
print(ans)

Solution (Python):
s = input()
s = s[:-2]
n = len(s)
ans = 0
for i in range(1,n):
  try:
    if s[:i] == s[i:i*2]:
      ans = max(ans, i*2)
  except:
    break
print(ans)

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    s = list(input()[:-1].decode())
    n = len(s)
    for i in reversed(range(n - 1)):
        if (i + 1) % 2 == 0:
            l = ''.join(s[:(i + 1) // 2])
            r = ''.join(s[(i + 1) // 2:i + 1])
            if l == r:
                print(i + 1)
                exit()


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
s=input()
cnt=0
while(1):
    if cnt>=1 and len(s)%2==0 and s[:(len(s)//2)]==s[(len(s)//2):]:
        print(len(s))
        break
    s=s[:-1]
    cnt+=1

Solution (Python):
def main():
    s=input()[:-2]
    while not is_even(s):
        s = s[:-2]
    print(len(s))

def is_even(s):
    half = len(s) // 2
    return s[:half] == s[half:]
    
if __name__ == "__main__":
    main()

Solution (Python):

import sys


def solve(S: str):
    if len(S)%2==1:
        S = S[:-1]
    else:
        S = S[:-2]

    while len(S):
        N = len(S) // 2
        if S[:N]==S[N:]:
            break
        S = S[:-2]

    print(len(S))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()
m = len(S)//2

for i in range(len(S)):
    m -= 1
    if S[:m] == S[m:m*2]:
        print(m*2)
        break

Solution (Python):
S = input() 
m = len(S)//2
for i in range(len(S)):
    m -= 1
    if S[:m] == S[m:m*2]:
        print(m*2)
        break

Solution (Python):
import sys
s=list(input())
for i in range(len(s)//2):
    s=s[:-2]
    sa=s[:len(s)//2]
    sb=s[len(s)//2:]
    if sa==sb:
        print(len(s))
        sys.exit()

Solution (Python):
S = input()

m = len(S)//2
for i in range(len(S)):
    m -= 1
    if S[:m] == S[m:m*2]:
        print(m*2)
        break

Solution (Python):
def resolve():
    s = input()
    len(s)

    for i in range(len(s)):
        s = s[0 : -1]
        
        if len(s) % 2 == 0:
            sa = s[0 : int(len(s)/2)]
            sb = s[int(len(s)/2) : ]
            
            if sa == sb:
                print(len(s))
                break
resolve()

Solution (Python):
s=input()
for i in range(200):
    s=s[0:len(s)-1]
    if len(s)%2==1:
        continue
    if s[0:len(s)//2]*2==s:
        print(len(s))
        exit()

Solution (Python):
s = input()
l = len(s)-2

while True:
    s = s[0:l]
    h = int(l/2)
    if s[0:h] == s[h:l]:
        print(l)
        exit(0)
    else:
        l = l-2

Solution (Python):
s = str(input())
for i in range(1, 200):
    a = s[:-i]
    if len(s)%2 != 0:
        pass
    elif a[:len(a)//2] == a[len(a)//2:]:
        print(len(a))
        break
    else:
        pass

Solution (Python):
S=input()
temp=len(S)+1
for i in range(0,temp):
  S=S[:-1]
  if len(S)%2==0 and S[0:len(S)//2]==S[len(S)//2:]:
    print(len(S))
    exit()

Solution (Python):
S = input()

deletes = -1
while len(S) + deletes > 0:
    
    test_s = S[:deletes]

    
    if len(test_s) % 2 == 0:
        l = test_s[:len(test_s) // 2]
        r = test_s[len(test_s) // 2:]

        if l == r:
            break

    deletes -= 1


print(len(test_s))

Solution (Python):
import sys
S=input()
for i in range(1,len(S)):
  S=S[:-1]
  if len(S)%2==0:
    c=len(S)
    if S[:c//2]==S[c//2:]:
      print(c)
      sys.exit()

Solution (Python):
s = list(str(input()))
d = len(s)
for i in range(d):
    s.pop()
    if len(s) % 2 == 0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break

Solution (Python):
s = input()
ans = 0
for i in range(1, len(s)):
    tmp = s[:i]
    if tmp[:i//2] == tmp[i//2:]:
        if len(tmp) > ans:
            ans = len(tmp)
print(ans)

Solution (Python):
s = input()

for i in range(len(s)):
	ss = s[:-(i+1)]
	if ss[:len(ss)//2] == ss[len(ss)//2:]:
		break

print(len(ss))

Solution (Python):
s=input()
x=len(s)
c=0
for j in range(x-1,0,-1):
    for i in range(1,(x-1)//2+1):
        if  s[0:i]*int(j//i)==s[0:j] and j//i%2==0:
            print(j)
            c+=1
            break
    if c==1:
        break

Solution (Python):
s = input()
slen = len(s)
for i in range(1, slen):
    s = s[:-1]
    slen = len(s)
    if i % 2 == 0:
        half = slen // 2
        if s[half:] == s[:half]:
            print(slen)
            break

Solution (Python):
s=input()
n=len(s)
if (n%2==0):
  s=s[:-2]
else:
  s=s[:-1]
n=len(s)
while n>0:
  if (s[:n//2]==s[n//2:]):
    print(n)
    break
  else:
    s=s[:-2]
    n-=2

Solution (Python):
def evenstring(s) : 
  while len(s) > 0 : 
    s = s[ : -2]
    t1 = s[ : int(len(s) / 2)]
    t2 = s[int(len(s) / 2) : ]
    if t1 == t2 : 
      return len(t1) + len(t2)
  

s = input()

print(evenstring(s))

Solution (Python):
s = list(input())

while (s):
    s.pop()
    s.pop()
    sl = s[:len(s) // 2]
    sr = s[len(s) // 2:]
    if sl == sr:
        
        
        print(len(sl) * 2)
        exit()

Solution (Python):
s = input()

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

Solution (Python):
S = input()
for i in range(1, len(S)):
    if (len(S) - i) % 2 == 0:
        tmp = S[:len(S)-i]
        left = tmp[:len(tmp)//2]
        right = tmp[len(tmp)//2:]
        if left == right:
            print(len(S) - i)
            exit()
print(0)

Solution (Python):
s = list(input())
n = len(s)
mid = (n//2)-1
del s[-2:]
m = 0
while mid > 0:
  if s[:mid]==s[mid:]:
    m = (mid<<1)
    break
  del s[-2:]
  mid-=1
print(m)

Solution (Python):

S =input()

m = 0
for i,s in enumerate(S):
    tmp = S[:-1-i]
    tmp1 = tmp[:len(tmp)//2]
    tmp2 = tmp[len(tmp)//2:]
    if len(tmp)%2==0 and(tmp1==tmp2):
        m = max(m,len(tmp))
print(m)

Solution (Python):
s = input()

l = len(s)
ans = l

for _ in range(l//2-1):
  l -= 2
  if s[0:l//2-1] == s[l//2:l-1]:
    ans = l
    break
    
print(ans)

Solution (Python):
s = input()
s = s[:-1]
ans = 0
while len(s) >= 2:
  if len(s) % 2 == 0:
    if s[:len(s) // 2] == s[len(s) // 2:]:
      ans = len(s)
      break
    else:
      s = s[:-1]
  else:
    s = s[:-1]
print(ans)

Solution (Python):
s = input()[:-1]

length = len(s)

for a in range(length, 1, -1):
  temp = s[:a]
  if len(temp) %2 == 0:
    half = len(temp)//2
    if temp[:half] == temp[half:]:
      ans = len(temp)
      break 
    
print(ans)

Solution (Python):

"""
@author: H_Hoshigi
09min 20sec WA
17min 25sec WA
"""






def main():
    S = input()
    n = len(S)//2
    answer = int()
    for i in range(1, n):
        
        if S[:(n-i)] == S[(n-i):2*(n-i)]:
            answer = 2*(n-i)
            break
    print(answer)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
s = input()

s = s[:-1]
length = len(s)

for a in range(length, 1, -1):
    tmp = s[:a]
    if len(tmp) % 2 == 0:
        half = len(tmp)//2
        if tmp[:half] == tmp[half:]:
            ans = len(tmp)
            break

print(ans)

Solution (Python):
s = list(input())
for i in range(len(s)):
    s.pop()
    if len(s) % 2 == 0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break

Solution (Python):
s=list(input())
n=len(s)
s1=s[:n//2]
s2=s[n//2:]
for i in range(n//2):
  s2=[s1[-1]]+s2[:-2]
  s1=s1[:-1]
  if s2==s1:
    break
print(len(s1+s2))

Solution (Python):

import math


def inp():
    return(int(input()))



def inlist():
    return(list(map(int, input().split())))



def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


s = input()

end = len(s)-1
res = 2
while end > 1:
    if end % 2 == 0:
        mid = end // 2
        left = s[:mid]
        right = s[mid:end]
        if left == right:
            res = len(left)
            break
        else:
            end -= 1
    else:
        end -= 1
print(res+res)

Solution (Python):
S = input()
N = len(S)

for i in range(N//2 -1):
  if S[:N//2-(i+1)] == S[N//2-(i+1):N-2*(i+1)]:
    print(N-2*(i+1))
    break

Solution (Python):
S = str(input())

S = S[:-1]
count = len(S)

while S[:len(S)//2] != S[len(S)//2:]:
  S = S[:-1]
  count -= 1

print(count)

Solution (Python):
S=input()
l=len(S)
for i in range(1,l+1):
    if S[:(len(S)-i)//2]==S[(len(S)-i)//2:-i]:
        print(len(S)-i)
        exit()

Solution (Python):
S = input()

import sys
S = S[:-1]

while len(S) > 1:
    if len(S)&1 == 1:
        S = S[:-1]
    else:
        ok = True
        mid = len(S)//2

        for i in range(mid):
            if S[i] != S[mid + i]:
                ok = False
                break
        
        if ok:
            print(len(S))
            sys.exit()
        
        S = S[:-1]

Solution (Python):
s=input()
si=s[::-1]
while len(si)>0:
    si=si[1:]
    if len(si)%2==0:
        u=len(si)//2
        if si[:u]==si[u:]:
            print(len(si))
            break

Solution (Python):
import sys


def is_even_seq(s):
    len_s = len(s)
    if len_s % 2 != 0:
        return False
    left = s[: (len_s // 2)]
    right = s[(len_s // 2) :]

    return left == right


def test():
    assert is_even_seq("abaababaab")


if __name__ == "__main__":
    S = input()
    for i in range(1, len(S) - 1):
        s = S[:-i]
        if is_even_seq(s):
            print(len(s))
            sys.exit(0)

Solution (Python):
s = list(input())

del s[-1]

for i in range(len(s)):
  mid = len(s) // 2
  front = ''.join(s[0:mid])
  rear = ''.join(s[mid:len(s)])


  if len(s) % 2 == 0 and front == rear:
    print(len(s))
    break
  else:
    del s[-1]

Solution (Python):
s=input()
ans=len(s)
for i in range(1,(ans//2)):
    ans-=2
    if s[:ans//2]==s[ans//2:ans]:
        break
print(ans)

Solution (Python):
S = input()

while True:
  S = S[:-2]
  l = len(S)
  T = S[:int(l/ 2)]
  U = S[int(l/ 2):]
  if(T == U):
    print(l)
    break

Solution (Python):
import sys

S=sys.stdin.readline()
for i in range(len(S)-2,-1,-1):
    if S[:i//2]==S[i//2:i]:
        print(i)
        exit()

Solution (Python):
if __name__ == '__main__':
    s = input()
    for i in range(1,len(s)):
        s2 = s[:len(s)-i]
        count =0
        if len(s2) % 2 ==0:
            for j in range(len(s2)// 2):
                if s2[j] == s2[len(s2)// 2 + j]:
                    count+=1


            if count == len(s2)//2:
                print(len(s2))
                break

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    S = list(input().rstrip())
    ok = False
    ans = len(S)
    while not ok:
        S.pop()
        ans -= 1
        if len(S) % 2 == 0 and S[:len(S)//2] == S[len(S)//2:]:
            ok = True
    print(ans)
if __name__ == "__main__":
    main()

Solution (Python):
S = input()
N = len(S)
for i in range(len(S) // 2 - 1, -1, -1):
    if S[:i] == S[i : 2 * i]:
        print(2 * i)
        break

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()

l = len(S)

S = S[:-1] if l % 2 != 0 else S[:-2]

for i in range(l // 2):
    if S[:l // 2 - i] == S[l // 2 - i:l - 2 * i]:
        print(l - 2 * i)
        break

Solution (Python):
S = list(input())

length = len(S)

while True:
    length -= 2
    half = length // 2
    if S[0] == S[half]:
        cnt = 0
        for i in range(half):
            if S[i] != S[half + i]:
                break
            cnt += 1
        
        if cnt == half:
            print(length)
            exit()

Solution (Python):
S = [i for i in str(input())]
S = S[:-2]

while True:
    if S[0:int(len(S)/2)] == S[int(len(S)/2):]:
        print(len(S))
        break
    else:
        S = S[:-2]

Solution (Python):
S = input()

S = S[:-2]
flg = True
while flg:
    flg = False
    x = 0
    for i in range(len(S)//2):
        if S[x] != S[len(S)//2 + x]:
            flg = True
            S = S[:-2]
            break
        x += 1

print(len(S))

Solution (Python):
S = list(input())
for i in range(len(S)):
    del S[- 1]
    if len(S) % 2 == 0:
        if S[: len(S) // 2] == S[len(S) // 2 :]:
            print(len(S))
            break

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    def check_even_string(s):
        n = len(s)
        if n % 2 != 0:
            return False
        for i in range(n//2):
            if s[i] != s[i+n//2]:
                return False
        return True
    

    
    s = input()
    n = len(s)
    for i in range(n - 1, 1, -1):
        if check_even_string(s[:i]):
            print(i)
            exit()


if __name__ == "__main__":
    main()

Solution (Python):
s=input()
cnt=len(s)-2
while cnt>0:
  
  if s[0:cnt//2]==s[cnt//2:cnt]:
    break
  cnt-=2
print(cnt)

Solution (Python):
import math
s = input()
flag=False
for i in range(len(s)):
  S=s[:len(s)-1-i]
  if len(S)%2==1:
    continue
  if len(S)>1:
    if S[:round(len(S)/2)]==S[round(len(S)/2):]:
      ans = len(S)
      flag=True
  else:
    ans=1
  if flag:
    break
print(ans)

Solution (Python):
s = input()

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

Solution (Python):
s = input()
i = 2
while True:
    
    
    if s[0:((len(s)-i)//2)] == s[((len(s)-i)//2):(len(s)-i)]:
        print(len(s[0:(len(s)-i)//2])*2)
        exit()
    else:
        i += 2

Solution (Python):
s = input()
x = len(s) - 1 if len(s) % 2 else len(s) - 2
for i in range(x, -1, -2):
	if s[:i//2] == s[i//2:i]:
		print(i)
		exit()

Solution (Python):
def oddmoji(x):
  lx=int(len(x)/2)
  if x[:lx]==x[lx:]:
    return True
  else:
    return False

s=input()
ls=len(s)
for i in range(ls-2, 0, -2):
  if oddmoji(s[:i]):
    print(i)
    break

Solution (Python):
S=list(input())
S.pop()
while len(S) != 0:
  l = len(S)
  if l%2==0:
    if S[0:l//2] == S[l//2:l]:
      print(l)
      break
  S.pop()

Solution (Python):
s = input()
n = len(s)

ans = 0
i = n
while True:
    if ans != 0 and s[0:i//2] == s[i//2:i]:
        print(n - ans)
        exit()
    i -= 2
    ans += 2

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

Solution (Python):
s=input()
n=len(s)
for i in range(1,n//2):
  if s[0:n//2-i]==s[n//2-i:n-2*i]:
    print(n-2*i)
    break

Solution (Python):
s=input()
n=len(s)
for i in range(2,n,2):
    if s[:(n-i)//2-1]==s[(n-i)//2:n-i-1]:
        print(n-i)
        break

Solution (Python):
S = input()
for i in range(2,len(S)+1,2):
    if S[:(len(S)-i)//2-1] == S[(len(S)-i)//2:len(S)-i-1]:
        print(len(S)-i)
        break

Solution (Python):
S = input()

for i in reversed(range(len(S))):
    tmp = S[:i]
    n = len(tmp)//2
    if tmp[:n] == tmp[n:]:
        print(len(tmp))
        break

Solution (Python):
def is_even_string(x):
    return x[:len(x)//2] == x[len(x)//2:]

s = input()

for i in range(len(s)-2,0,-2):
    sub=s[:i]
    if is_even_string(sub):
        print(len(sub))
        break

Solution (Python):
S = input()
n = len(S)-1
while n > 0:
    if n % 2 == 1:
        n -= 1
        continue
    m = n//2
    if S[:m] == S[m:+2*m]:
        break
    n -= 1

print(n)

Solution (Python):
S = input()
for i in reversed(range(len(S)-1)):
    if i %2 == 0:
        continue
    else:
        if S[0:i//2] == S[i//2+1:i]:
            print(i+1)
            break

Solution (Python):
s = input()
n = len(s)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main(x):
        xlen=len(x)
        if x==x[:xlen//2]*2:
            return True
        else:
            return False
    s=input()
    for i in range(2,len(s),2):
        x=s[:-i]
        if main(s[:-i]):
            print(len(s[:-i]))
            break
resolve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main(x):
        xlen=len(x)
        if x==x[:xlen//2]*2:
            return True
        else:
            return False
    s=input()
    if len(s)==2:
        print(1)
    else:
        for i in range(2,len(s)-1,2):
            x=s[:-i]
            if main(s[:-i]):
                print(len(s[:-i]))
                break
resolve()

Solution (Python):
s=input()
n=len(s)//2
n-=1
while n!=0:
  if s[:n]==s[n:2*n]:
    print(2*n)
    break
  n-=1

Solution (Python):
S = list(input())[::-1]
s = len(S)
ans = -1
for i in range(1, s):
  if S[2*i:(2*i+s-1)//2+1] == S[(2*i+s-1)//2+1:]:
    ans = s-2*i
    break
print(ans)

Solution (Python):
s = input()
n = len(s)

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

Solution (Python):
s = input()
l = len(s)
for i in range(1,l):
    tmp = s[:l-i]
    thl = len(tmp) // 2
    
    if tmp[:thl] == tmp[thl:]:
        print(len(tmp))
        break

Solution (Python):
s = input().strip()
s = s[:-2]


def is_even_string(string):
    l = len(string)
    first = string[:l//2]
    last = string[l//2:]
    return first == last


while not is_even_string(s):
    s = s[:-2]

print(len(s))

Solution (Python):
s = input()

l = len(s)
start = 2 if l % 2 == 0 else 1

isFound = False
for i in range(start, len(s), 2):
    m = int((l-i)/2)
    if s[0:m] == s[m:(l-i)]:
        isFound = True
        print(l-i)
        break

if not isFound:
    print(-1)