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):
def main():
    import sys
    
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations
    
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    

    

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


if __name__ == '__main__':
    main()

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

Solution (Python):
S=str(input())
S=S[:len(S)-1]
if len(S)%2==1:
    S=S[:len(S)-1]
while S[:len(S)//2]*2!=S:
    S=S[:len(S)-2]
print(len(S))

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

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

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

if len(s)%2 == 1:
    s =  s[:len(s)-1]
    
while s[:len(s)//2]*2 !=  s:
    s =  s[:len(s)-2]
    
print(len(s))

Solution (Python):
strs = input()

ans = 0
length = 0
single = ''

for idx, s in enumerate(strs[:(len(strs)-1)//2]):
    single += s
    length += 1
    comp = strs[idx+1:idx+length+1]
    if single == comp:
        ans = length * 2

print(ans)

Solution (Python):


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

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

Solution (Python):
s = input()
l = len(s)
ans = 0
search = l-1

if search < 2:
    print(0)
    exit()

while search >= 2:
    if search % 2 == 0:
        if s[0:search//2] == s[search//2:search]:
            ans = max(ans, search)
    else:
        pass
    search -= 1
print(ans)

Solution (Python):

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

Solution (Python):
a = list(input())
b = len(a)
while True:
  del a[-1]
  b -= 1
  if b % 2 == 0 and a[:b//2] == a[b//2:]:
    print(b)
    break

Solution (Python):
S = input()

for i in range(1,len(S)) :
    if (len(S)-i)%2 == 1 :
        continue
    else :
        halflen = (len(S)-i) // 2
        preS = S[:-i-halflen]
        postS = S[halflen:-i]
        if preS == postS :
            print(len(S)-i)
            exit()

Solution (Python):
S=list(input())
S_re=list(reversed(S))
N=len(S)

if N%2==0:
    start=2
else:
    start=1

ans=0
for i in range(start,N,1):
    S_=S[i:]
    S_re_=S_re[i:]
    l_S=len(S_)
    if S_[l_S//2:]==S_[:l_S//2] and ans<l_S:
        ans=l_S
    if S_re_[l_S//2:]==S_re_[:l_S//2] and ans<l_S:
        ans=l_S

print(ans)

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

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

Solution (Python):
def main():
    S = list(input())
    for i in range(1, len(S)-1):
        sub_str = S[:len(S)-i]
        if len(sub_str) % 2 == 1:
            continue
        elif sub_str[:int(len(sub_str)/2)] == sub_str[int(len(sub_str)/2):]:
            print(len(sub_str))
            break

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

i = len(s)
index = 0

while(1):
    i = i-1
    s = s[:i]
    if len(s) % 2 == 0:
        if s[:i//2] == s[i//2:]:
            index = i
            break
    if i == 0:
        break


print(index)

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

y = []
for i in range(1, int(n/2)):
    x = l[0:i*2]
    if x[0:int(len(x)/2)] == x[int(len(x)/2):]:
        y.append(len(x))
    
print(max(y))

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

x = 0
y = []
for i in range(1, int(n/2)):
    x = l[0:i*2]
    if x[0:int(len(x)/2)] == x[int(len(x)/2):]:
        y.append(len(x))
    
print(max(y))

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

if __name__ == '__main__':
    S = input()
    S = S[:len(S)-1]
    while not is_even_str(S):
        S = S[:len(S)-1]
    print(len(S))

Solution (Python):


S = input().strip()

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

Solution (Python):
s = input()
n = len(s)
for i in range(n):
  s = s[:-1]
  l = len(s)
  if len(s) % 2 == 0 and s[:l//2] == s[l//2:]:
    print(len(s))
    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):
s = list(input())

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

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

Solution (Python):
s = list(str(input()))
for p in range(int(len(s))):
    del s[-1]
    t = int(len(s))
    if t % 2 == 0:
        for i in range(t//2):
            if s[i] != s[i+t//2]:
                break
        else:
            print(t)
            break

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

print(len(s))

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


if __name__ == '__main__':
    main()

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

def symmetry(x):
    l = len(s)//2
    if x[l:] == x[:l]:
        return True
    else:
        return False
    
s.pop(-1)
while not(symmetry(s)):
    s.pop(-1)
    
print(len(s))

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

Solution (Python):
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i

    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)

Solution (Python):
s = input()

len_s = len(s)
for i in range(1, len_s):
    t = s[:len_s-i]
    len_t = len(t)
    if s[:len_t//2] == s[len_t//2:len_s-i]:
        print(len_t)
        break

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

Solution (Python):
s=input()

def isg(s):
        if len(s)%2!=0:
                return False
        s1=s[:len(s)//2]
        s2=s[len(s)//2:]
        return s1==s2

while len(s) != 0:
        s=s[:-1]
        if isg(s):
                print(len(s))
                exit()

Solution (Python):
S = input()

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

Solution (Python):
s = input()

ans = 0
for i in range(len(s)):
    if i == 0:
        s = s[:-1]
        continue
    else:
        a = len(s)
        t = s[a//2:]
        if s == t + t and len(s)%2 == 0:
            ans = 1
            break
        else:
            s = s[:-1]

print(len(s))

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

Solution (Python):
s = input()
a = ""
b = ""
if len(s) % 2 == 1:
  s = s[:len(s)-1]
  a = s[:len(s)//2]
  b = s[len(s)//2:]
  if a == b:
    print(len(s))
    exit()

while len(s) > 0:
  s = s[:len(s)-2]
  a = s[:len(s)//2]
  b = s[len(s)//2:]
  if a == b:
    print(len(s))
    break

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

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

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

Solution (Python):
def judge(s):
    l=len(s)
    if l%2 ==0 and s[:l//2]==s[l//2:]:
        return True
    else:
        return False
s=input()
for i in reversed(range(1,len(s))):
    ns=s[:i]
    if judge(ns):
        print(len(ns))
        exit(0)

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

Solution (Python):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

s = ns()
n = len(s)

ans = 0
for i in range(2, n, 2):
    flag = True
    m = i // 2
    for j in range(m):
        if s[j] != s[j + m]:
            flag = False
    if flag:
        ans = i

print(ans)

Solution (Python):
s=input()
while len(s)>0:
  s=s[:-2]
  a=len(s)
  if s[:(a//2)]*2==s:
    print(a)
    exit()

Solution (Python):
s = list(input())
s = s[:-1]  
while True:
    n = len(s)
    if n % 2 == 1:
        s = s[:-1]
        continue
    a = n //2
    if s[:a] == s[a:]:
        print(n)
        exit()
    else:
        s = s[:-1]

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

Solution (Python):
s=input()

def is_guumoji(s):
    l=len(s)
    h=l//2
    s1=s[:h]
    s2=s[h:]
    if s1==s2: return True
    else: return False

s=s[:-2]
while 1:
    if is_guumoji(s):
        print(len(s))
        break
    else:
        s=s[:-2]

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

Solution (Python):

s=list(input())
n=len(s)
for i in range(n):
    del s[-1]
    del s[-1]
    n-=2
    if s[:n//2]*2==s:
        print(n)
        break

Solution (Python):
s = [x for x in input()]
if len(s) % 2 == 0:
    s = s[:-2]
while True:
    fin = 1
    half = len(s) // 2
    for i in range(half):
        if s[i] == s[half+i]: continue
        else:
            fin = 0
            s = s[:-2]
            break
    if fin: break
print(len(s))

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

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

Solution (Python):
S = input()

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

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

for i in range(l)[::2]:
    if s[:-i-2] == s[:len(s[:-i-2])//2]*2:
        print(len(s[:-i-2]))
        exit()

Solution (Python):
S = input()
n = len(S)
ok = False
while not ok:
    n -= 2
    flag = True
    for i in range(n//2):
        if S[i] != S[i+n//2]:
            flag = False
    if flag:
        ok = True
print(n)

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

Solution (Python):
if __name__ == "__main__":
    s = input()

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

Solution (Python):
s = input()

r = 0
while len(s) > 0:
  s = s[:-2]
  if s[:int(len(s)/2)] == s[int(len(s)/2):]:
    r = len(s)
    break
    
print(r)

Solution (Python):
S = input()

for i in range(1,len(S)):
    T = S[:-i]
    if len(T)&1:
        continue
    else:
        T1, T2 = T[:len(T)//2], T[len(T)//2:]
    if T1==T2:
        print(len(T))
        exit()

Solution (Python):
S=input()
s=""
s1=""
s2=""
for i in range(len(S)-1):
    s=S[:len(S)-i-1]
    if (len(s)%2==0):
        s1=s[:int(len(s)/2)]
        s2=s[int((len(s)+1)/2):]
        if s1==s2:
            print(len(s))
            break

Solution (Python):
def ss(s):

    ans = 0
    ss = s
    flag = True

    while flag:
        ss = ss[:int(len(ss)-2)]
        if ss[:int(len(ss)/2)] == ss[(int(len(ss)/2)):]:
            ans += len(ss)
            flag = False

    return ans

def main():
    s = str(input())
    print(ss(s))

if __name__ == '__main__':
    main()

Solution (Python):
S = input()

tmp = S

def check_rotate(tmp):
  a = tmp[0:len(tmp) // 2]
  b = tmp[len(tmp) // 2:]
  
  if a == b:
    return len(a) * 2
  else:
    return 0

  
ans = 0
for i in range(1, len(S)-1):
  tmp = S[0:-i]
  if len(tmp) % 2 == 1:
    continue
  check_rotate(tmp)
  ans = max(ans, check_rotate(tmp))
print(ans)

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

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

for i in reversed(range(0, len(s)+2, 2)):
    half = i//2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[:-2]

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

for i in reversed(range(0, len(s)+2, 2)):
    half = i//2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[:-2]

Solution (Python):
S = input()

s = []
for i in range(len(S)):
    s.append(S[i])
ans = 0

while(1):
    n = len(s)
    del s[n-1]
    a = ""
    b = ""
    n = len(s)
    if n%2==1:
        continue
    for i in range(n//2):
        a = a+s[i]
    for i in range(n//2):
        b = b+s[n//2+i]
    if a==b:
        ans = len(a)+len(b)
        break

print(ans)

Solution (Python):




def main():
    S = list(input())
    for _ in range(len(S)):
        S.pop()
        if S[:len(S) // 2] == S[len(S) // 2:]:
            print(len(S))
            break


if __name__ == "__main__":
    main()

Solution (Python):
str = input()

def checkstr(str):
    if len(str) % 2 != 0: return False
    half = int(len(str) / 2)
    if str[0:half] == str[half:len(str)]: return True
    else: return False

for x in range(len(str) -1):
    answer = len(str) - (x + 1)
    check = checkstr(str[0:answer])
    if check == True: break
print(answer)

Solution (Python):
s = input()
ans = 0

while len(s) > 1:
  s = s[:-1]
  
  if len(s) % 2 != 0:
    continue
  
  m = len(s) // 2
  if s[:m] == s[m:]:
    break

print(len(s))

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

Solution (Python):
S = input()

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

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

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

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

Solution (Python):
s=list(input())
for x in range(len(s)-2,0,-2):
    t=s[0:x]
    a="".join(s[0:x//2])
    b="".join(s[x//2:x])
    if a==b:
        print(len(t))
        break

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

count = 0
while A:
    A = A[:-2]
    lenght = len(A) // 2
    if A[lenght:] == A[:lenght]:
        count = lenght * 2
        break

print(count)

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
s=input()
n=len(s)
ans=0
while len(s)>0:
  s=s[:-2]
  ans+=2
  if s[:(n-ans)//2] == s[(n-ans)//2:]:
    print(n-ans)
    exit()

Solution (Python):
s = input()

S = s[:-1]

for i in range(len(s)):
    if len(S) % 2 == 0:
        c= len(S)//2
        a = S[0:c]
        b = S[c:len(S)]
        if a == b:
            print(len(s)-i-1)
            break
        else:
            S = S[:-1]
    else:
        S = S[:-1]

Solution (Python):
s = input()

for i in range(len(s) - 1, 0, -1):
  s2 = s[:i]
  if not len(s2) % 2 == 0:
    continue
  
  mid = int(len(s2) / 2)
  if s2[0:mid] == s2[mid:]:
    print(len(s2))
    break

Solution (Python):
S = input()
for i in range(len(S)):
  sub_len = len(S) - i - 1
  substring = S[:sub_len]
  former = substring[:sub_len//2]
  latter = substring[sub_len//2:]
  if former == latter:
    print(sub_len)
    break

Solution (Python):
s = input()

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

Solution (Python):
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')
ans = 0
for i in range(2, len(S) + 1):
    ck = S[:-1 * i]
    if len(ck) % 2 == 0:
        if ck[:len(ck) // 2] == ck[len(ck) // 2:]:
            ans = len(ck)
            break
print(ans)

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

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):
s=str(input())[:-1]
while(True):
  i=len(s)//2
  if s[:i]==s[i:]:
    print(len(s))
    break
  else:
    s=s[:-1]

Solution (Python):
s=str(input())
c=0
while(True):
  if len(s)%2==1:
    s=s[:-2]
    continue
  i=len(s)//2
  if s[:i]==s[i:] and c!=0:
    print(len(s))
    exit()
  else:
    s=s[:-2]
    c+=1

Solution (Python):

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

Solution (Python):
def solve(s):
    for size in range(len(s) // 2 - 1, 0, -1):
        if s[:size] == s[size:2 * size]:
            return 2 * size
    return 0

_s = input()
print(solve(_s))

Solution (Python):
s = input()

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

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    s=STR()
    n=len(s)
    for i in range(1,len(s)):
        if (len(s)-i)%2==1:
            pass
        else:
            
            temp1=s[0:(n-i)//2]
            temp2=s[(n-i)//2:n-i]
            
            
            if temp1==temp2:
                print(n-i)
                break
if __name__ == '__main__':
    do()

Solution (Python):
S = input()

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

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

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

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
from bisect import bisect
 
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

def main():
    s = list(input())
    
    s.pop()

    l = s[0:len(s)//2]
    r = s[len(s)//2:]

    while l != r:
        s.pop()
        l = s[0:len(s)//2]
        r = s[len(s)//2:]
        
    print(len(s))
if __name__ == "__main__":
    main()

Solution (Python):


slist = list(input())

slist.pop()

if len(slist) % 2 == 1:
  slist.pop()

result = 0
while len(slist) > 0 :
   l = int(len(slist) / 2)


   flist = slist[0:l]
   rlist = slist[l:]


   if "".join(flist) == "".join(rlist) :
      result = len(slist)
      break
   slist.pop()
   slist.pop()

print(result)

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

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

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

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

Solution (Python):







def intinput():
    return int(input())

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

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

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

Solution (Python):
S = input()

while 2 <= len(S):
    S = S[:len(S)-2]
    center = int(len(S)/2)

    if S[:center] == S[center:]:
        print(int(len(S)))
        break

Solution (Python):
s = input()
flag = -1
k = -1
for i in range(len(s)):
  flag += 1
  k += 1
  a = s[0:(len(s)-k)//2]
  b = s[(len(s)-k)//2:(len(s)-k)]
  if a == b:
    if flag != 0:
      print(len(a)+len(b))
      break

Solution (Python):
import sys
s=input()

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

Solution (Python):
S = list(input())
answer = 0
while True:
    if len(S) >= 1:
        S.pop(-1)
        
        
        if S[0:len(S)//2] == S[len(S)//2:-1]:
            answer = len(S)-1
            break
    else:
        break
    
print(answer)

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

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

for i in range(2, len(s), 2):
	y = s[:-i]
	h = int(len(s[:-i]) // 2 )
	if y[:h] == y[h:]:
		print(len(y))
		exit()

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

ans = 0

for i in range(1,length):
    test_str = strings[:-i]
    if len(test_str) % 2 == 1:
        pass
    elif len(test_str) % 2 == 0:
        splitter = int(len(test_str) / 2)
        if test_str[splitter:] == test_str[:splitter]:
            if splitter > ans:
                ans = splitter*2

print(ans)

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):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def reverse_range(Large_a, Small_b, i):  
    return range(Small_b, Large_a, -i)[::-1]  


def crange(a, b, i):
    return range(a, b + 1, i)


def reverse_crange(Large_a, Small_b, i):
    return range(Small_b, Large_a, -i)

















































def main():
    s = input().strip()
    lll = [i for i in range(1, len(s)-1)[::-2]]
    for i in lll:
        eprint("range", end=": ")
        eprint(lll)
        
        if s[0: i//2] == s[i//2: i]:
            print(i)
            return
        else:
            eprint("debug ", end=": ")
            eprint("false this time")
    return


if __name__ == '__main__':
    main()

Solution (Python):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def reverse_range(Large_a, Small_b, i):  
    return range(Small_b, Large_a, -i)  


def crange(a, b, i):
    return range(a, b + 1, i)


def reverse_crange(Large_a, Small_b, i):
    return range(Small_b, Large_a, -i)

















































def main():
    s = input().strip()
    lll = [i for i in crange(len(s) - 2, 0, -2)]
    for i in crange(len(s) - 2, 0, -2):
        i=i-1
        eprint("crange", end=": ")
        eprint(lll)
        s = s[0:i]
        if s[0:i // 2] == s[i // 2 + 1:i]:
            print(i+1)
            return
        else:
            eprint("debug ", end=": ")
            eprint("false this time")
    return


if __name__ == '__main__':
    main()

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

if len(S) % 2 == 0:
  S.pop(-1)

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

print(len(S))

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

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

Solution (Python):
S = list(input())
l = len(S)
a = 1
for i in range(l) :
    del S[-1]
    ll = len(S)
    if ll % 2 == 0 :
        for j in range((ll)//2) :
            if S[j] == S[(ll)//2 + j] :
                continue
            else :
                a = 0
                break
    else :
        a = 0
    if a == 1 :
        break
    a = 1
print(len(S))

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()
ans = 0
l = len(s)

while True:
    s = s[:l-2]
    l -= 2
    if s[:l//2] == s[l//2:]:
        ans = l
        break

print(ans)

Solution (Python):
s = input()

m = 0
for i in range(len(s)-1, -1, -1):
    tmp = s[:-i]
    len_tmp = len(tmp)
    if len_tmp % 2 != 0:
        continue
    center = len_tmp // 2
    former = tmp[:center]
    latter = tmp[center:]
    if former == latter:
        m = max(m, len_tmp)
print(m)

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

Solution (Python):
import sys
input = sys.stdin.readline
s=input().strip()
flg=True

s=s[:-2]
while len(s)>=2:
    for i in range(len(s)//2):
        if s[i]!=s[len(s)//2+i]:
            flg=False
    if flg:
        print(len(s))
        exit()
    s=s[:-2]
    flg=True

Solution (Python):


import numpy as np
import fractions as fra

def che(s):
    n=len(s)
    if(n%2==1):return 0
    for i in range(n//2):
        if(s[i]!=s[i+n//2]):
            return 0
    return 1

s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)):
        if(i==0 and j==len(s)-1):
            continue
        if(che(s[i:j+1])):
            ans=max(ans,j+1-i)

print(ans)

Solution (Python):
s=list(input())
a=list(set(s))
if len(a)==1:
    print(len(s)-2)
else:
    while True:
        del s[-2:]
        if s[:(len(s)//2)]==s[(len(s)//2):]:
            print(len(s))
            exit()