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):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



s = input()[:-1]
n = len(s)
for i in reversed(range(1, n, 2)):
    left = s[: i // 2 + 1]  
    right = s[i // 2 + 1: i + 1]  
    
    
    if left == right:
        print(i + 1)
        break

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

Solution (Python):
s = [i for i in input()]

s = s[:-2]
while not s[:len(s)//2] == s[len(s)//2:]:
    s = s[:-2]
print(len(s))

Solution (Python):
S=input()
n=len(S)
for i in range(2,n-2+1,2):
  m=int((n-i)/2)
  SF=S[0:m]
  SR=S[m:m*2]
  if SF==SR:
    
    print(len(SF+SR))
    break

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

Solution (Python):
S=[i for i in input()]
n=len(S)
for i in range(2,n-2+1,2):
  m=int((n-i)/2)
  SF=S[0:m]
  SR=S[m:m*2]
  if SF==SR:
    
    print(len(SF+SR))
    break

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

Solution (Python):
def resolve():
    S = input()
    while True:
        S = S[:-2]
        if S[:len(S)//2] == S[len(S)//2:]:
            print(len(S))
            return



if '__main__' == __name__:
    resolve()

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

while True:
    s.pop()
    l=len(s)
    if l%2==0 and s[0:l//2]==s[l//2:] :
        print(l)
        exit()

Solution (Python):
s = input()

while True:
    s = s[:-1]
    n = len(s)
    if n%2==1:
        continue
    if s[:n//2]==s[n//2:]:
        print(n)
        exit()

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

ans = None
for i in range(1,L):
  if (L - i) % 2 != 0:
    continue
  ns = S[:-i]
  h = (L - i) // 2
  m = ns[:h] + ns[:h]
  if ns == m:
    ans = ns
    break
    
print(len(ans))

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

print(ans)

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

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

Solution (Python):
import sys


def main():
    S = input()

    while len(S) > 1:
        S = S[:-2]
        mid = len(S)//2
        left = S[:mid]
        right = S[mid:]
        if left == right:
            print(len(S))
            return


main()

Solution (Python):

def gusu(s):
    l = len(s)
    if l % 2 == 0:
        s_1 = s[:(l//2)]
        s_2 = s[(l//2):]
        if s_1 == s_2:
            return True
        
    return False

s = input()

for i in range(len(s),-1,-1):
    tmp = s[:]
    tmp = tmp[:i-1]
    if gusu(tmp):
        print(len(tmp))
        break

Solution (Python):
S = input()

def is_even_string(string):
    
    if string[:len(string)//2] == string[len(string)//2:]:
        return True
    else:
        return False

for i in range(2, len(S), 2):
    new_S = S[:len(S)-i]
    
    if is_even_string(new_S):
        print(len(new_S))
        exit(0)

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
s = input()

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

Solution (Python):
S = input()

for i in range(2,len(S),2):
    s = S[:-i]
    zenhan = s[:len(s)//2]
    kouhan = s[len(s)//2:]
    if zenhan == kouhan:
        print(len(s))
        break

Solution (Python):
def myAnswer(S:list) -> int:
   ans = 0
   for i in range(len(S)):
      S.pop() 
      if(len(S) % 2 == 1):
         continue
      middle = len(S) // 2
      if(S[middle:] == S[:middle]):
         ans = len(S)
         break
   return ans





def modelAnswer():
   tmp=1
def main():
   S = list(input())
   print(myAnswer(S[:]))
if __name__ == '__main__':
   main()

Solution (Python):
S=input().rstrip()
L=l=len(S)
ans=0
for i in range(L-2,-1,-1):
  l-=1
  if l%2==1:
    continue
  f=True
  m=l//2
  for j in range(0,m):
    if S[j]!=S[m+j]:
      f=False
      break
  if f:
    ans=i+1
    break
print(ans)

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

s_rev = list(reversed(s))
n = len(s_rev)

for i in range(n):
  del s_rev[0]
  if len(s_rev) % 2 == 1:
    continue
  elif s[0:len(s_rev)// 2] != s[(len(s_rev) // 2):len(s_rev)]:
    continue  
  elif len(s_rev) != 0:
    print(len(s_rev))
    break

Solution (Python):

s = input()
if len(s) % 2 == 0:
    flag = 1
else:
    flag = 0

def search_ss(s, flag):
    for i in range(len(s) - 1 - flag, -1, -2):
        judge = True
        for j in range(i // 2):
            if s[j] != s[i // 2 + j]:
                judge = False
                break
        if judge == True:
            print(i)
            exit()

search_ss(s, flag)

Solution (Python):
s = input()
rev = s[::-1]
n = len(s)
for i in range(1, n):
  l = s[i:]
  r = rev[i:]

  if l[:(n-i)//2] == l[(n-i)//2:] or r[:(n-i)//2] == r[(n-i)//2:]:
    print(n-i)
    break

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

Solution (Python):
s = input()
s = s[:-1]
while True:
    num = len(s)

    if num%2 == 0 and s[:num//2] == s[num//2:]:
        print(len(s))
        exit()
    else:
        s = s[:-1]

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

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

Solution (Python):
S = input()
for i in range(2, len(S), 2):
    s = S[0:-i]
    mid_s = int(len(s) / 2)
    s_1 = s[:mid_s]
    s_2 = s[mid_s:]
    if s_1 == s_2:
        ans = len(s_1) * 2
        break
print(ans)

Solution (Python):
def IsEvenString(sl):
    Nsl = len(sl)
    if Nsl%2 is not 0:
        return False
    else:
        if sl[:Nsl//2] == sl[-Nsl//2:]:
            return True
        else:
            return False

S = input()

LS = len(S)
i = LS%2
j = LS // 2
N = 0
for k in range(1,j):
    
    if IsEvenString(S[:LS-2*k+i]):
        N = LS-2*k+i
        break


print(N)

Solution (Python):
S=input()
A = ""
B = ""
if len(S)%2 == 0:
    N = len(S)//2-1
else : N = len(S)//2
while True:
    for i in range(N):
        A += S[i]
        B += S[i+N]
    if A == B:
        print(len(A)*2)
        break
    else:
        N -= 1
        A = ""
        B = ""

Solution (Python):
S = input()

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

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

Solution (Python):

s = input()

while True:
    s = s[:-1]
    if len(s) % 2 == 1:
        continue
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        print(len(s))
        break

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

Solution (Python):


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

def checkss(str):
    ntemp=int(len(str)/2)
    a=str[0:ntemp]
    b=str[ntemp:]
    if a==b:
        return ntemp*2
    else:
        return -1

while True:
    ans=checkss(s)
    if ans>0:
        print(ans)
        break
    else:
        s=s[0:len(s)-2]

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

for i in range(2, len(S), 2):
    length = N - i
    if S[:length//2] == S[length//2:length]:
        print(length)
        break

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

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

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

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

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

for i in range(1,len(s_l)):
    s_l2 = s_l[:-i]
    if len(s_l2)%2 != 0:
        continue
    for j in range(len(s_l2)//2):
        if s_l2[j] != s_l2[j+len(s_l2)//2]:
            find = False
            break
        find = True
    if find:
        break

print(len(s_l2))

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

def even_str(s):
    if len(s)%2 != 0:
        return False
    elif s[:len(s)//2] == s[len(s)//2:]:
        return True
    else:
        return False
for i in range(2, len(s), 2):
    if even_str(s[:-i]):
        print(len(s)-i)
        break

Solution (Python):
s = input()
lst = []
for i in range(len(s)):
    text = s[0:-i]
    
    if len(text)%2==0 and len(text)!=0:
        n = len(text)//2
        if text[:n] == text[n:]:
            lst.append(len(text))
print(max(lst))

Solution (Python):
s=input()

x=0
for i in range(len(s)):
    s=s[:len(s)-1]
    x+=1
    if len(s)%2==0 and s[0:len(s)//2]==s[len(s)//2:len(s)]:
        break

print(len(s))

Solution (Python):
S = input().strip()
n = len(S)

for i in range(n-2, 0, -2):
  S = S[:i]
  k = i // 2
  if S[k:] == S[:k]:
    print(i)
    exit()

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

for i in range(1,L):
    l = (L // 2 - i)
    if s[0:l] == s[l:L - 2 * i]:
        ans = l * 2
        break

print(ans)

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

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

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

Solution (Python):
def resolve():
    s = input()
    l = len(s)
    for i in range(2, l, 2):
        test = s[0:(l-i)]
        t = len(test)
        if test[0:(t//2)] == test[(t//2):t]:
            print(len(test))
            exit()
resolve()

Solution (Python):
s=list(input())
if len(s)%2==1:
    s=s[:-1]
else:
    s=s[:-2]

while True:
    l=len(s)//2
    s0=s[:l]
    s1=s[l:]
    if s0==s1:
        print(l*2)
        exit()
    else:
        s=s[:-2]

Solution (Python):
lis=list(input())
lislen=len(lis)
ma=0
for a in range(1,(len(lis)-1)//2+1):
    if lis[0:a]==lis[a:a+a]:
        ma=a*2
print(ma)

Solution (Python):
lis=list(input())
lislen=len(lis)
ma=0
for a in range(1,(len(lis)-1)//2+1):
    if lis[0:a]==lis[a:a+a]:
        ma=a*2
print(ma)

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

Solution (Python):
s = list(input())
c = len(s) -2

for i in range(c,0,-1):
    lst = [x for idx, x in enumerate(s) if idx <= i]
    for ix in range(1, len(lst)+1):
        if lst[0:ix] == lst[ix:len(lst)]:
            print(len(lst))
            break
    else:
        continue
    break

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

Solution (Python):
s = list(input())
ans = 0
for i in range(len(s)):
    s.pop()
    if len(s)%2==1:
        continue
    else:
        i = 0
        while i < len(s)//2:
            if s[i]!=s[i+len(s)//2]:
                break
            
            if i==len(s)//2-1:
                ans = len(s)
            
            i += 1
        if ans > 0:
            break
print(ans)

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

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))
        break
    else:
        s = s[:-2]

Solution (Python):
def guumojiretu(s):
    num = len(S)
    if S[:num // 2] == S[num//2:]:
        return True
    return False
S = input()
S = S[:-1]
while True:
    if guumojiretu(S):
        break
    S = S[:-1]
print(len(S))

Solution (Python):
S = input()
ans = ""
now = 0
for i in range(0,len(S)//2):
  ans += S[2*i]
  ans += S[2*i+1]
  if ans[0:i+1] == ans[i+1:len(ans)]:
    if 2*(i+1) == len(S):
      continue
    else:
      now = 2*(i+1)
print(now)

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

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

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

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

def f():
    for erase in range(1, N + 1):
        new = S[0 : N - erase]
        if len(new) % 2 == 1: continue
        flg = 1
        for i in range((N - erase) // 2):
            if new[i] != new[(N - erase) // 2 + i]: 
                flg = 0
                break
        if not flg: continue
        return len(new)

print(f())

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

Solution (Python):
S=input()
for n in range(2-(len(S)&1), len(S), 2):
    m = (len(S)-n)//2
    for i in range(m):
        if S[i] != S[i+m]: break
    else:
        print(m*2)
        exit()

Solution (Python):
def resolve():
  s = input()
  ans = ""

  for i in range(1, len(s) // 2):
    a = s[0:i]
    b = s[i:2*i]
    if a == b:
      ans = len(a) + len(b)

  print(ans)
  return

if __name__ == "__main__":
  resolve()

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

for i in range(n):
    s.pop()
    
    
    if s[0:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        exit()

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

Solution (Python):
def main():
    s = input()

    n = len(s)
    for i in range(n // 2):
        s = s[:-2]
        if s[0:n//2-i-1] == s[n//2-i-1:n-i*2-2]:
            print(n-i*2-2)
            return

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
ans = 0
for i in range(len(s)):
        t = s[:i]
        if t[:i//2]*2==t: ans = i
print(ans)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    S = input().strip("\n")
    lenS = len(S)
    for i in range(1, lenS//2):
        if S[:(lenS - 2 * i) // 2] == S[(lenS - 2 * i)// 2: lenS - 2 * i]:
            print(lenS - 2 * i)
            break

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
def main():
    S = [s for s in input()]
    N = len(S)
    S.pop()
    S.pop()
    N -= 2
    while S and S[:N//2] != S[N//2:]:
        S.pop()
        S.pop()
        N -= 2
    print(N)


if __name__ == '__main__':
    main()

Solution (Python):
def judge(S):
    n = len(S)
    if n % 2 == 0 and S[:n//2] == S[n//2:]:
        return True
    else:
        return False


S = input()
S = S[:-1]
while not judge(S):
    S = S[:-1]
print(len(S))

Solution (Python):
def solve():
    s = input()
    for i in range(2,len(s)):
        ed = len(s)-i
        mid = ed//2
        if s[:mid] == s[mid:ed]:
            print(len(s[:ed]))
            return
if __name__=='__main__':
    solve()

Solution (Python):
S = input()

for i in range(1, len(S)):
    if i % 2 > 0: continue
    ans = None
    for j in range((len(S) - i) // 2):
        if S[j] == S[j + (len(S) - i) // 2]:
            continue
        else:
            break
    else:
        ans = len(S) - i
    
    if ans != None: break

print(ans)

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    S = input()
    N = len(S)
    res = 0
    for i in range(N//2):
        a = S[:i]
        b = S[i:2*i]
        if a == b:
            res = max(i,res)

        

    print(res*2)
if __name__ == "__main__":
    resolve()

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

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

Solution (Python):
S = [i for i in input()]
while True:
    S.pop(-1)
    if len(S)%2==0:
        s = ''.join(S)
        s1 = s[:(len(S)//2)]
        s2 = s[len(S)//2:]
        if s1 == s2:
            print(len(S))
            exit(0)
    elif len(S)==0:
        print(0)
        exit(0)

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = read().rstrip().decode()
for check in range(len(s) - 2, -1, -2):
    if s[check // 2:check] == s[:check // 2]:
        print(check)
        exit()

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

for i in range(len(S)):
    del S[-1]
    if len(S) % 2 ==0:
        for j in range(len(S)//2):
            if S[j] == S[j+len(S)//2]:
                if j == len(S)//2-1:
                    print(len(S))
                    exit()
            else:
                break

Solution (Python):
data = input()
for _ in range(len(data)):
    data = data[:-1]
    count = len(data)
    if data[:count//2] == data[count//2:]:
        print(count)
        break

Solution (Python):
list_S = list(input())
n = len(list_S)
ans = 0
for i in range(n):
    list_S.pop(-1)
    for j in range(1, n-i):
        if "".join(list_S[:j]) == "".join(list_S[j:]):
            k = 2*j
            ans = max(ans, k)

print(ans)

Solution (Python):
ss = input()
for i in range(2, len(ss), 2):
    tt = ss[:-i]
    l = len(tt) // 2
    if tt[:l] == tt[l:]:
        print(len(tt))
        break

Solution (Python):
s = input()

for i in range(1,len(s)):
  x = s[:-i]
  if len(x)%2 !=0:
    continue
  else :
    a = x[:len(x)//2]
    b = x[len(x)//2:]
    if a ==b :
      print(len(x))
      exit()

Solution (Python):

url = "https://atcoder.jp//contests/abc066/tasks/abc066_b"

def main():
    pat = input()
    for i in range(len(pat) - 1, 0, -1):
        ind = i // 2
        a = ''.join(pat[:ind])
        b = ''.join(pat[ind:i:])
        if a == b:
            print(i)
            exit()
    print(1)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()
L = len(S)
n = 0

for i in range(L):
  if (L - (i + 1)) % 2 == 0:
    M = int((L - i - 1) / 2)
    if S[:M] == S[M:L-1-i]:
      n = L-1-i
      break
print(n)

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

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

len(N)


N = N[:len(N)-1]



while True:        
    if len(N) % 2 != 0:

        N = N[:len(N)-1]
 
    else:
        N1 = N[:len(N)//2]
        N2 = N[len(N)//2:]
  
        if N1 == N2:
   
            print(len(N))
            break
        else:
            N = N[:len(N)-1]

Solution (Python):
import itertools
import math
S = input()

ans = 0
for i in range(len(S)):
    temp = S[:i]
    l = len(temp)
    if l % 2 == 0:
       if  temp[:l//2] == temp[l//2:]:
           ans = max(l,ans)
print(ans)

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

Solution (Python):
S = input()
cnt = 0

for i in range(len(S)):
  if S[0:len(S)//2] == S[len(S)//2:len(S) + 1] and cnt != 0:
    print(len(S))
    exit()
  else:
    cnt += 1
    S = S[0:len(S) - 1]

Solution (Python):
s = input() 

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

    if len(s) % 2 != 0:
        continue

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

Solution (Python):
s=input()
a=0
for x in range(len(s)-1):
    if x%2==0: continue
    for y in range(0,int((x+1)/2)):
        if(s[y]!=s[int((x+1)/2)+y]): break
        if(y==(x-1)/2): a=2*(y+1)
print(a)

Solution (Python):
S = input()

for i in range(len(S) - 3, -1, -2):
    d = i // 2 + 1
    if S[0:d] == S[d:2 * d]:
        print(2 * d)
        break

Solution (Python):
S = list(input())
N = int(len(S) / 2)

for i in range(N):
    del S[-2:]
    if S[:int(len(S)/2)] == S[int(len(S)/2):]:
        print(len(S))
        break
    else:
        continue

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

Solution (Python):
s=input()
ans=0
flg=True
i=2 if len(s) % 2 == 0 else 1
while flg and i<len(s):
  t=s[:-i]
  if t[:len(t)//2]==t[(len(t)//2):]:
    ans = len(t)
    flg=False
  i+=2
print(int(ans))

Solution (Python):

s = input()

for _ in range(len(s)):
    s = s[:-1]

    if len(s) % 2 == 0:
        length = len(s)
        if s[:length // 2] == s[length // 2:]:
            print(length)
            break

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

Solution (Python):
S = input()


def f(S):
    idx = len(S) // 2
    sub1 = S[:idx]
    sub2 = S[idx:]
    return sub1 == sub2


for i in range(len(S) - 1, -1, -1):
    if f(S[:i]):
        print(i)
        exit()

Solution (Python):
S = input()

for i in range(1, len(S)):
    S = S[:-1]
    if len(S) % 2 == 1:
        continue
    if S[:len(S)//2] == S[len(S)//2:]:
        break

print(len(S))

Solution (Python):
S = input()

N = len(S)
import sys

for i in range(1,N-1):
    if i%2 == 0:

        if S[:(N+1-i)//2] == S[(N+1-i)//2:N-i]:
            print(N-i)
            sys.exit()

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

Solution (Python):

s = list(input())

for i in range(len(s)):
    s.pop()
    s.pop()
    num =int(len(s)/2)
    if s[:num] == s[num:]:
        print(len(s))
        break

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

Solution (Python):
s = input().strip()
while True:
    s = s[:-2]
    le = len(s)
    half = len(s) // 2
    if (le % 2 == 0) and s[:half] == s[half:]:
        print(le)
        exit()

Solution (Python):
def check(a):
  n=len(a)
  if n%2:
    return -1
  else:
    if s[0:n//2]==s[n//2:n]:
      return 0
    else:
      return -1

s=input()
x=len(s)
for i in range(1,x):
  A=s[0:x-i]
  if check(A)==0:
    print(len(A))
    break

Solution (Python):
s = input()
for i in range(2, 200, 2):
    t = s[:-i]
    l = len(t)
    if t[:l//2] == t[l//2:]:
        print(l)
        exit()

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()

len_s = len(s)

for i in range(int(len_s/2+1)):
    if i != 0:
        if s[0:int(-i+len_s/2)] == s[int(-i+len_s/2):(len_s-i*2)]:
            print(len_s-i*2)
            break

Solution (Python):
s = input()

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

Solution (Python):
S =input()
n = len(S)
while True:
    S = S[:-2]
    n -= 2
    if S[:n//2] == S[n//2:]:
        print(n)
        break

Solution (Python):
S = input()

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

Solution (Python):
def guumoji(s):
    if len(s)%2 != 0:
        return False
    else:
        s1 = s[:int(len(s)/2)]
        s2 = s[int(len(s)/2):]
        if s1 == s2:
            return True
        else:
            return False
s = input()
i = 2
while i < len(s):
    s0 = s[:-i]
    if guumoji(s0):
        break
    else:
        i += 2
print(len(s0))

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

Solution (Python):
def solve():
    S = input()

    end = len(S) - 1
    while end >= 2:
        if isEvenStr(S[:end]):
            print(end)
            break
        end -= 1

def isEvenStr(s):
    if len(s) % 2 != 0:
        return False
    
    if s[:len(s)//2] == s[len(s)//2:]:
        return True
    else:
        return False

if __name__ == '__main__':
    solve()

Solution (Python):
S = input()
N = len(S)
for i in range(2, N, 2):
    S = S[:-2]
    middle_idx = int(len(S)/2)
    left = S[:middle_idx]
    right = S[middle_idx:]

    if left == right:
        print(int(2*len(right)))
        break

Solution (Python):
S = input()

tail = 2
for i in range(1,len(S)//2):
    
    

    if S[0:len(S)//2-i] == S[len(S)//2-i:len(S)-tail]:
        print(len(S[0:len(S)//2-i]) * 2)
        exit()
    tail += 2

Solution (Python):
S = list(input())
N = len(S)
s = S[:N//2]
for _ in range(N//2):
    S.pop(-1)
    S.pop(-1)
    s.pop(-1)
    if s + s == S:
        break
print(len(S))

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

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