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 os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    S = S[:-1]
    for _ in range(len(S)):
        l = len(S)
        if l % 2 == 0 and S[:l // 2] == S[l // 2:]:
            print(len(S))
            exit()
        else:
            S = S[:-1]


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
S = input()

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

Solution (Python):
def guu(s):
    if len(s)%2==1:
        return 0
    a=len(s)//2
    if s[0:a]==s[a:]:
        return 1
    else:
        return 0
s=list(input())
s.pop(-1)
while guu(s)==0:
    s.pop(-1)
print(len(s))

Solution (Python):
def gumoji(s):
    l=len(s)
    if s[:l//2]==s[l//2:]:
        return True
    return False
s=input()
n=len(s)

for i in range(n-2):
    check=s[:n-i-1]
    if gumoji(check):
        print(len(check))
        break

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

    n -= 1
    s = s[:n]

print(n)

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

for i in range(2, len_S+1, 2):
    check_S = S[:-i]
    len_check_S = len(check_S)
    half = len_check_S//2
    if check_S[:half] == check_S[half:]:
        print(len_check_S)
        break

Solution (Python):
S=input()
check=S
flg=0
P=list(check)
while True:
    P.pop(-1)
    P.pop(-1)
    naga=int(len(P)/2)
    for i in range(0,naga):
        if P[i]==P[naga+i]:
            flg=1
        else:
            flg=0
            break
    if flg==1:
        break
print(len(P))

Solution (Python):
S=input()
check=S
flg=0
check.rstrip()
check.rstrip()
P=list(check)
while True:
    P.pop(-1)
    P.pop(-1)
    naga=int(len(P)/2)
    for i in range(0,naga):
        if P[i]==P[naga+i]:
            flg=1
        else:
            flg=0
            break
    if flg==1:
        break
print(len(P))

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

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

for i in range(2, N, 2):
    t = (N - i) // 2
    A = S[:t]
    B = S[t: N - i]
    if A == B:
        print(N - i)
        break

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

Solution (Python):
s = input()
s = s[0:len(s)-2]
while True:
	count = len(s)
	n = count // 2
	front_s = s[0:n]
	back_s = s[n:count]
	if front_s == back_s:
		break
	s = s[0:count-2]
print(len(s))

Solution (Python):
s=list(input())
while(True):
    s.pop()
    s.pop()
    tmp=len(s)//2
    ans=0
    for i in range(tmp):
        if s[i]==s[i+tmp]:
            ans+=1
    if ans==tmp:
        print(tmp*2)
        break

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

Solution (Python):


S = input()
S_len = len(S)

while True:
    S = S[:S_len - 2]
    S_len = len(S)

    middle = S_len // 2

    if S[:middle] == S[middle:]:
        print(S_len)
        exit()

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())

    while True:
        del S[-1]
        ln = len(S)
        if ln % 2 == 0:
            l = "".join(S[:ln // 2])
            r = "".join(S[ln // 2:])
            if l == r:
                print(len(S))
                break


if __name__ == '__main__':
    main()

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""








def main():
  """s = input()
  s_l = len(s)
  L = list(set(list(s)))
  
  L_l = len(L)
  comp = s[:s_l - 1]
  for i in range(s_l-1):
    i = 1
    for j in range(L_l): 
      if comp.count(L[j]) % 2 == 0:
        if i == len(L):
          print(len(comp))
          exit()
        else:
          i += 1
      else:
        comp = comp[:len(comp)-1]
  print(1)"""
  s=input()
  while True:
    s=s[:-1]
    k=len(s)
    if s[0:k//2]==s[k//2:]:
        print(k)
        exit()
if __name__ == '__main__':
  main()

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

maxlen = 0
for i in range(length//2-1):
  if s[0:(i+1)] == s[(i+1):2*(i+1)]:
    maxlen = 2*(i+1)
    
print(maxlen)

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

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

Solution (Python):
import sys

S = list(input())

nS = S
i = 0

while len(nS) > 2:
    i += 1
    lns = len(S) - 2*i
    nS = S[:lns]
    nS1 = "".join(nS[:lns//2])
    nS2 = "".join(nS[lns//2:])
    if nS1 == nS2:
        print(len(nS))
        sys.exit()

print(1)

Solution (Python):
import sys
import numpy as np

input = input()
s = np.array([c for c in input])
ans = 0
for i in range(1, s.size):
    if s.size - i % 2 is not 0:
        if ''.join(np.array_split(s[0:s.size - i], 2)[0]) == ''.join(np.array_split(s[0:s.size - i], 2)[1]):
            ans = max(ans, s.size - i)
print(ans)

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

t = len(s)
s = s[:t-1]
for _ in range(t):
    if len(s) % 2 != 0:
        s = s[:len(s)-1]
        continue
    if s[:(len(s)//2)] == s[len(s)//2:]:
        print(len(s))
        break
    else:
        s = s[:len(s)-2]

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

Solution (Python):
S = list(input())
while(len(S)>=1):
    del S[-1]
    if len(S)%2!=0:
        continue
    else:
        center = len(S)//2
        f_S = S[0:center]
        s_S = S[center:len(S)]
        
        if f_S == s_S:
            ans = len(S)
            break
print(ans)

Solution (Python):
S = input()

for i in range(1, len(S)):
    T = S[:-i]
    if len(T)%2 != 0:
        continue

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

Solution (Python):
s = input()

for i in range(len(s) // 2):
    if s[0:i] == s[i:i * 2]:
        ans = i * 2

print(ans)

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=2
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def is_gg(s):
	if len(s)%2 == 1:
		return False
		
	mannaka=len(s)//2
	for a,b in zip(s, s[mannaka:]):
		if a!=b:
			return False
	return True
	
	
def main():
	s = input()
	for i in range(1, len(s)):
		if is_gg(s[:len(s)-i]):
			return len(s) - i
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
s = input()
n = len(s)
for i in range(2, n, 2):
    head = s[:-i]
    is_ok = True
    for j in range(len(head)//2):
        if head[j] != head[j + len(head)//2]:
            is_ok = False
    if is_ok:
        print(len(head))
        break

Solution (Python):
S = input()

def gusuretu(S):
    if S[ : len(S) // 2] == S[len(S) // 2 : ]:
        return True
    else:
        return False

S = S[: len(S) - 1]
while True:
    if gusuretu(S):
        print(len(S))
        break
    S = S[:len(S) - 1]

Solution (Python):
s=input()

kazu = len(s)

for i in range(kazu-2,1,-2):
    if s[:i//2]==s[i//2:i]:
        print(i)
        break

Solution (Python):
s = input()

def func(x):

    center = len(x) // 2

    s1 = x[:center]
    s2 = x[center:]

    if s1 == s2:
        return len(x)
    else:
        return func(x[:-1])

ans = func(s[:-1])

print(ans)

Solution (Python):












mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    s = input()
    ans = 0
    for i in range(len(s)-2,-1,-1):
        if (i+1)%2==0:
            res = True
            for j in range((i+1)//2):
                if s[j]!=s[j+(i+1)//2]:
                    res = False
                    break
            if res:
                ans = i + 1
                break
    print(ans)
    return

if __name__=='__main__':
    main()

Solution (Python):

def is_odd_str(str):
    length=len(str)
    if length%2==1:
        return False
    else:
        if str[:length//2]==str[length//2:]:
            return True
        else :
            return False
S = input()
rep = len(S)
for i in range(rep):
    S = S[:-1]
    if is_odd_str(S):
        print(len(S))
        break

Solution (Python):
def oddstirng(s):
    if len(s)%2!=0:
        return 0
    else:
        s1 = s[:len(s)//2]
        s2 = s[len(s)//2:]
        if s1!=s2:
            return 0
        else:
            return len(s)
            
S = input()[:-1]
while(True):
    
    j = oddstirng(S)
    if j!=0:
        print(j)
        break
    else:
        S=S[:-1]

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

Solution (Python):
S = input()

for x in range(len(S) - 2, 1, -2):
    sliceX = S[0:x]
    firstX = sliceX[0:(x // 2)]
    laterX = sliceX[(x // 2):]
    if firstX == laterX:
        print(len(sliceX))
        break

Solution (Python):
s = input()
n = len(s)
ans = 0
for i in range(n//2):
    ok = True
    for j in range(i):
        if s[j] != s[i+j]:
            ok = False
    if ok:
        ans = i * 2
print(ans)

Solution (Python):
S = input()
N =len(S)
for i in reversed(range(2,N,2)):
    l = i//2


    if S[:l] == S[l:i]:
        print(len(S[:i]))
        break

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

def stringcounter(M):
    if len(M)%2 ==0 and M[:len(M)//2]==M[len(M)//2:]:
        return True
    else:
        return False
while True:
    if stringcounter(S)==True:
        print(len(S))
        break
    else:
        S = S[:-1]

Solution (Python):
s = list(input())
l = len(s)
while True:
    l -= 2
    if s[0 : l // 2] == s[l // 2 : l]:
        ans = l
        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))
            exit()

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

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

if len(s) %2 == 1:
  s.pop(-1)
else:
  s.pop(-1)
  s.pop(-1)

while len(s) != 0:
  l = len(s)
  if s[:l//2] == s[l//2:]:
    print(l)
    break
  s.pop(-1)
  s.pop(-1)

Solution (Python):
s=input()
s=s[:-1]
def Evenstring(str):
    if len(str)%2==0 and str[:len(str)//2]==str[len(str)//2:]:
        return True
    else:
        return False

while True:
    if Evenstring(s)==True:
        print(len(s))
        break
    else:
        s=s[:-1]

Solution (Python):
s=input()
s=s[:-1]
def Evenstring(str):
    if len(str)%2==0 and str[:len(str)//2]==str[len(str)//2:]:
        return True
    else:
        return False

counter=0

while True:
    if Evenstring(s)==True:
        print(len(s))
        break
    else:
        s=s[:-1]
        
    counter+=1    
    if counter>300:
        break

Solution (Python):
def evenStringChecker(s):
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        return True
    else :
        return False

S = input()

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

while True:
    flag = evenStringChecker(S)
    if flag :
        break
    S = S[:len(S)-2]

print(len(S))

Solution (Python):
S = str(input())
x = len(S)
for i in range(1,int(x/2)):
    ss = S[:(-2)*i]
    y = int(len(ss)/2)
    k = ss[:-y]
    if ss == k * 2:
        print(y*2)
        exit()

Solution (Python):
s=list(input())
ans=len(s)//2

if ans==1:
    print("1")
    exit()

while 1:
    del s[-2:]
    ans-=1
    if s[:ans]==s[ans:]:
        print(ans*2)
        exit()

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

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

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

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

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

Solution (Python):
s = input()

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

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

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

Solution (Python):
def main():
    s = list(input())
    ans = 0
    flg = 0
    for i in range(1,len(s)-1,2):
        cpy_s = s[:i+1]
        cpy_size = i+1
        for j in range(cpy_size//2):
            if cpy_s[j] == cpy_s[j + cpy_size // 2]:
                continue
            else:
                flg = 1
                break
        if flg == 0:
            ans = cpy_size
        flg = 0
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
S = list(input())
for x in range(len(S) - 2):
  if len(S) % 2 != 0 or x == 0:
    S.pop(-1)
    continue
  i = len(S) // 2
  if S[:i] * 2 == S:
    break
  else: S.pop(-1)
print(len(S))

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

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    s = ns()
    s0 = s[0]
    n = len(s)
    m = (n-1)//2 + 1
    for i in range(1, m):
        if s[i] == s0:
            if s[:i] ==s[i:2*i]:
                ans = i*2
    print(ans)

if __name__ == "__main__":
    main()

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

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

def evenStr():
    halfLen = len(S) // 2
    left = S[0:halfLen]
    right = S[halfLen:]
    if left == right:
        return True
    else:
        return False

while 1:
    strLen -= 2
    S = S[0:strLen]
    if evenStr():
        print(str(len(S)))
        break

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

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

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

Solution (Python):
def solve():
    s = input()
    lens = len(s)
    for i in range(1, lens // 2):
        sub = lens - 2 * i
        if s[:sub // 2] == s[sub//2:sub]:
            print(sub)
            break
if __name__ == "__main__":
    solve()

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
s = input()
ans = 0
for k in range(1,len(s)):
    if len(s[:-k])%2 == 0:
        t = s[:-k]
        if t[:len(t)//2] == t[len(t)//2:]:
            ans = max(ans,len(t))
print(ans)

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

Solution (Python):
S = input()

ans = 1
for right in range(2, len(S)):
    T = S[: right]
    if T == S:
        break
    if len(T) % 2 == 0 and T[: len(T) // 2] == T[len(T) // 2:]:
        ans = max(ans, len(T))

print(ans)

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = list(input())
n = len(s)
ans = 0
while s:
    s.pop()
    ans +=1
    if len(s) % 2 == 0:
        m = len(s) // 2
        if s[0: m] == s[m:]:
            print(n-ans)
            exit()

Solution (Python):
def main():
    S = input()
    N = len(S)
    for i in range(1, N):
        s = S[:-i]
        M = len(s)
        if M % 2:
            continue
        if s[:M//2] == s[M//2:]:
            print(M)
            break


if __name__ == '__main__':
    main()

Solution (Python):
s = str(input())
n = len(s)
for i in reversed(range(n-1)):
    s_ = s[0:i]
    if len(s)%2 ==1:
        continue
    else:
        t = s_[0:(i//2)]
        if s_ == t + t:
            print(len(s_))
            exit()

Solution (Python):

s = list(input())

s.pop()
while True:
    if len(s) % 2 == 1:
        s.pop()
    flag = True
    for i in range(len(s) // 2):
        if s[i] != s[i + len(s) // 2]:
            flag = False
    if not flag:
        s.pop()
    if flag:
        print(len(s))
        break

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

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


def check(L):
    if len(L)%2 != 0:
        return False
    
    n = int(len(L)/2)
    if L[:n] == L[n:]:
        
        return True





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

Solution (Python):
s=input()
for i in range(1,len(s)):
    s1=s[0:len(s)-i]
    if len(s1)%2!=0:
        continue

    s2=s1[0:len(s1)//2]
    s3=s1[len(s1)//2:len(s1)]
    if s2==s3:
        print(len(s1))
        exit()

Solution (Python):
s = input()

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

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

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

ans=0
for i in range(2,N,2):
    T=S[:-i]
    M=len(T)//2
    if T[:M]==T[M:]:
        ans=max(ans,len(T))

print(ans)

Solution (Python):

s=input()

def func(mid):
    flag=True
    for i in range(mid):
        if s[i]!=s[mid+i]:
            flag=False
    return flag

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

Solution (Python):












s = input()

slis = list(s)
slis = slis[:-1]

ans = len(s)

while len(slis) > 0:
    if len(slis)%2 == 1:
        slis = slis[:-1]
        continue
    else:
        slicenum = len(slis)//2
        if slis[:slicenum] == slis[slicenum:]:
            ans = len(slis)
            break
        else:
            slis =slis[:-1]
            continue
    
print(ans)

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

Solution (Python):
string = input()

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

    if len(s)%2 == 1:
        continue
    else:
        half = int(len(s)/2)
        s1 = s[:half]
        s2 = s[half:]

        if s1 == s2:
            print(half*2)
            break

Solution (Python):

import sys


def solve(S: str):
    for i in reversed(range(1, len(S) // 2)):
        if S[:i] == S[i:2 * i]:
            print(2 * i)
            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):

import sys

def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    S = input()
    answer = len(S)-1

    def is_even(s):
        if len(s)&1:
            return False
        
        half_length = len(s)//2
        if s[:half_length] == s[half_length:]:
            return True
        else:
            return False
    
    while True:
        S = S[:-1]
        if is_even(S):
            print(len(S))
            return
        
        answer -= 1
    return

if __name__ == '__main__':
    main()

Solution (Python):








def resolve():
    S=list(input())
    while True:
        S.pop(-1)
        l=len(S)
        if S[:l//2]==S[l//2:]:
            print(l)
            break



resolve()

Solution (Python):
s = input()
n = len(s)
s = s[:-2]
for _ in range(n):
  n = len(s)
  m = int(n/2)
  if s[:m] == s[m:]:
    print(len(s))
    break
  else:
    s = s[:-2]

Solution (Python):
S=input()
for i in range (len(S)):
	if S[:i]==S[i:i*2]:
		if i*2<len(S):
			ans=i*2
print(ans)

Solution (Python):
s = list(input())
n = len(s)
while len(s) > 1:
    s.pop(-1)
    
    if len(s)%2 == 0:
        s1 = s[0:len(s)//2]
        s2 = s[len(s)//2:]
        
        
        if s1 == s2:
            print(len(s))
            exit()

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

Solution (Python):
S=['a','x','z','c']
S=input()
words=[a for a in S]
n=len(words)
if n%2==1:
    del words[-1]
else:
    del words[-2:]
while True:
    n=len(words)
    m=round(n/2)
    if words[:m]==words[-m:]:
        print(n)
        break
    else:
        del words[-2:]

Solution (Python):



import sys
sys.setrecursionlimit(200000000)






def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N=input()
    n=len(N)//2
    ans=0
    
    for i in range(n):
        if N[0:i]*2==N[0:i*2]:
            ans=max(ans,i*2)
    print(ans)
        
     
"""


"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """abaababaab"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """xxxx"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """abcabcabcabc"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """akasakaakasakasakaakas"""
        output = """14"""
        self.assertIO(input, output)
if __name__=="__main__":resolve()

Solution (Python):
import sys
s=input().strip()
for i in range(1,1000):
  r=-2*i
  s2 = s[:r]
  half=len(s2)//2
  if s2[half:]==s2[:half*-1]:
    print(len(s)+r)
    sys.exit()

Solution (Python):


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

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    
    def ch(s):
        n=len(s)
        s1=s[:n//2]
        s2=s[n//2:]
        if s1==s2:
            return True
        else:
            return False
        
    S=input()    
    N=len(S)-1
    ans=0
    for i in range(1,N):
        S2=S[:N-2*i]
        if ch(S2):
            ans=N-2*i
            break
    print(ans)

main()

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