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.



Sample input:
abaababaab


Sample output:
6

Submission status: Accepted

Solution code:
s = input()

ans = 0
for i in range(len(s)-1, 1, -1):
    s_l = s[:i]
    if len(s_l)%2==1:
        continue
    else:
        if s_l[:len(s_l)//2] == s_l[len(s_l)//2:]:
            ans = max(ans, len(s_l))
if len(s)<= 3:
    print(1)
else:
    print(ans)

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
while True:
    if len(s) % 2 == 0:
        b = True
        for i in range(len(s) // 2):
            if s[i] != s[i + len(s) // 2]:
                b = False
        if b:
            print(len(s))
            exit()
    s = s[:-1]

Submission status: Accepted

Solution code:
s = input()

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

for i in range(1,len(s)):
    if f(s[0:len(s)-i]):
        print(len(s[0:len(s)-i]))
        break

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)-1):
    s = s[::-1]        
    s = s.replace(s[0],'',1)
    s = s[::-1] 
    a = s[0]
    for j in range(1,int(len(s)/2)+1):
        a += s[j]
        if a * (int(len(s)/len(a))) == s and (int(len(s)/len(a)) % 2 == 0 or s.count(s[0]) == len(s)):
            print(len(a * (int(len(s)/len(a)))))
            exit()

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
#ABC066.py
s=input()
L=len(s)
Ans=0
for k in range(2,L):
    i=L-k
    t=i+1
    A=0
    if t%2==0:
        for l in range(0,int(t/2)):
            if s[l]==s[l+int(t/2)]:
                A=A+1
            else:
                continue
    if A==int(t/2):
        Ans=i+1
        break

print(Ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = list(input())
while len(s)>1:
  s=s[:-1]
  l=len(s)
  if l%2==0:
    if s[:l//2]==s[l//2:]:
      print(l)
      break

Submission status: Accepted

Solution code:
s = list(input())
s.pop(-1)
while len(s):
    ln = len(s)
    if ln%2 == 0:
        h = int(ln/2)
        lef = s[:h]
        rig = s[h:]
        if lef == rig:
            break
    s.pop(-1)
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

for i in range(len(s)):

    if len(s)%2==0 and i!=0:
        if s[:int(len(s)/2)]==s[int(len(s)/2):]:
            print(len(s))
            break
    s.pop(-1)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
# ABC 66, B - ss
s = input()
for i in range(1, len(s)-1):
    ss = s[:-i]
    if len(ss) % 2 == 0:
        half = int(len(ss)/2)
        if ss[:half] == ss[half:]:
            print(len(ss))
            break

Submission status: Accepted

Solution code:
import sys
s = input()
l = len(s)
del_len_max = l-2
del_len_min = 1 if l%2 == 1 else 2
if del_len_min == del_len_max:
    print(del_len_max)
    sys.exit()
for i in range(del_len_min, del_len_max+2, 2):
    before = s[0:(l-i)//2]
    after = s[(l-i)//2:l-i]
    if before == after:
        print(l-i)
        sys.exit()

Submission status: Accepted

Solution code:
S = input()
if len(S)%2 != 0:
  S = S + '?'
for i in range(len(S)-1)[::-2]:
  if S[:i//2] == S[i//2:i]:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(S: str):
    for i in range(2, len(S), 2):
        s = S[:len(S)-i]
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    s = input()
    
    leng = len(s)
    
    for i in range(leng-1, -1, -1):
        testtest = s[0:i]
        
        tmp = is_run(testtest)
        if tmp == True:
            print(len(testtest))
            sys.exit()
            
    print(0)
    
    
    
def is_run(s):
    leng = len(s)
    if leng % 2 == 1:
        return False
        
    bese = int(leng/2)
    tmp1 = s[:bese]
    tmp2 = s[bese:]
    
    #print("{} {}".format(tmp1,tmp2))
    
    if tmp1 == tmp2:
        return True
    else:
        return False
        
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = list(input())
s = s[:len(s) - 1]
for i in range(len(s)):

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def main(S):
    while(True):
        S.pop()
        if(len(S)%2==1):
            continue
        elif(S[0:int(len(S)/2)]==S[int(len(S)/2):len(S)+1]):
            print(len(S))
            break       
        
if __name__ == '__main__':
    S = input()
    main(list(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

s.pop(-1)

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

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(1,len(s)+1//2):
    if s[:i*2].count(s[:i]) == 2:
        if len(s[:i]) * 2 != len(s):
            ans = len(s[:i]) * 2
print(ans)

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
S = input()
s_list = list(S)
n = len(s_list)

for i in range(1,n):
    a = s_list[:-i]
    if len(a)%2 == 0:
        half = a[:int(len(a)/2)]
        
        if half + half == a:
            break
    
print(len(a))

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LI()
    print(min(a+b,b+c,c+a))
    return

#B
def B():
    def check(s):
        x = len(s)
        if x % 2:
            return False
        if s[:x // 2] == s[x // 2:]:
            return True
    s = S()
    for i in range(1,len(s)):
        if check(s[: - i]):
            print(len(s) - i)
            return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()[:-1]
while True:
    if len(a) % 2 != 0:
        a = a[:-1]
    else:
        b = True
        for i in range(len(a) // 2):
            if a[i] != a[i + len(a) // 2]:
                b = not b
                a = a[:-1]
                break
        if b:
            print(len(a))
            exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
a = a[:len(a) - 1]
while True:
    if len(a) % 2 != 0:
        a = a[:len(a)-1]
    else:
        b = True
        for i in range(len(a) // 2):
            if a[i] != a[i + len(a) // 2]:
                b = not b
                break
        if b:
            print(len(a))
            exit()
        a = a[:len(a)-1]

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC66 B

s = input()

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

Submission status: Accepted

Solution code:
S = str(input())
for i in range(len(S)-1,1,-1):
    tmp = S[0:i]
    if len(tmp)%2==0:
        flag = True
        for j in range(len(tmp)//2):
            if tmp[j]!=tmp[len(tmp)//2+j]:
                flag = False
                break
        if flag == True:
            print(len(tmp))
            break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(1, len(s)//2):
    for j in range(i):
        if s[j] != s[j+i]:
            break
    else:
        ans = max(ans, i*2)
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    for j in range(len(S) - 1, 0, -1):
        if len(S[:j]) % 2 == 1:
            continue
        i = len(S[:j]) // 2
        if S[:i] == S[i:j]:
            print(len(S[:j]))
            break


main()

Submission status: Accepted

Solution code:

S = input()
ori = len(S)

while True:

    if len(S)%2 == 0 and S[:len(S)//2] == S[len(S)//2:] and ori != len(S):

        #print(S[:len(S)//2], S[len(S)//2:])
        print (len(S))
        break

    else:

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

Submission status: Accepted

Solution code:
S = list(input())

def is_same(S):
    if len(S) % 2 != 0:
        return False
    mid = len(S) // 2
    S1 = S[:mid]
    S2 = S[mid:]
    for s1, s2 in zip(S1, S2):
        if s1 != s2:
            return False
    return True

for i in range(len(S)):
    S.pop()
    if is_same(S):
        print(len(S))
        break

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
# ABC066-B
S = input()
flag = False
for i in range(len(S)):
    L = len(S)
    S = S[0 : L-1]   # 末尾消去
    L = len(S)   
    if L % 2 == 0:
        short_L = int(L / 2)
        if S[0 : short_L] == S[short_L : L]:
            ans = L
            break
print(ans)

Submission status: Accepted

Solution code:
a = list(str(input()))

for i in range(len(a)):
  a.pop()
  if i%2==0:
    pass
  else:
    if a[0:int(len(a)/2)]==a[int(len(a)/2):len(a)]:
      print(len(a))
      break

Submission status: Accepted

Solution code:
import sys 
s=input()
s=s[:len(s)-1]
for i in range(len(s)):
    #print("s:{},長さ:{},前半:{},後半:{}".format(s,len(s),s[:int(len(s)/2)],s[int(len(s)/2):]))
    if len(s)%2==0 and (s[:int(len(s)/2)]==s[int(len(s)/2):]):
        print(len(s))
        sys.exit()
    else:
        s=s[:len(s)-1]

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

S = list(input())
A_li = []
B_li = []

for i in range(1, len(S) + 1):
    S_del = S[:-i]
    A_li = S_del[0:len(S_del) // 2]
    B_li = S_del[len(S_del) // 2::]
    if A_li == B_li:
        print(len(A_li) * 2)
        exit()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
from collections import Counter

S = list(input())
A_li = []
B_li = []

for i in range(1, len(S) + 1):
    S_del = S[:-i]
    A_li = S_del[0:len(S_del) // 2]
    B_li = S_del[len(S_del) // 2::]
    if A_li == B_li:
        print(len(A_li) * 2)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()
a=a[:-2]
while a[(len(a)//2):]!=a[:(len(a)//2)]:
    a=a[:-2]
print(len(a))

Submission status: Accepted

Solution code:
a = str(input())
a = a[:-2]
l = len(a)
while a[:l//2] != a[l//2:]:
    a = a[:-2]
    l = len(a)
print(len(a))

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)):
    s = s[0:len(s) - 1]
    if(len(s) % 2 != 0):
        continue
    if(s[0:len(s)//2] == s[len(s)//2:]):
        ans = len(s)
        break
print(ans)

Submission status: Accepted

Solution code:


def main():
    data = input()
    ans = 0
    for i in range(1, len(data) // 2):
        a = data[:i]
        b = data[i : 2 * i]
        if a == b:
            ans = 2 * i

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
ans = 0
for i in range(1,(len(S)//2)):
    if S[0:i] == S[i:2*i]:
        ans = 2*i
print(ans)

Submission status: Accepted

Solution code:
def ok(s):
    if s[:len(s)//2]==s[len(s)//2:]:
        return True
    return False
s = input()
for i in range(1,201):
    if ok(s[:len(s)-i]):
        print(len(s)-i)
        break

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

S = s()

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

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)):
    L = len(S) - i*2
    s = ""
    for p in range(L//2):
        s += S[p]
    ss = ""
    for q in range(L//2):
        ss += S[p+1+q]

    if s == ss:
        print(L)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = len(S)

while ans:
    ans -= 2
    S = S[0:-2]
    if S[0:ans // 2] == S[ans // 2:]:
        break

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(S: str):
    n = len(S)
    for i in range(2, n, 2):
        mid = (n - i) // 2
        if S[:mid] == S[mid:n - i]:
            ret = n - i
            break
    print(ret)
    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
N=len(S)
for i in range(1,N):
    if len(S[:N-i])%2==0 and S[:(N-i)//2]==S[(N-i)//2:N-i]:
        print(N-i)
        quit()

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


s = IS()
ans = -INF
for i in range(2, len(s), 2):
    if s[:i//2] == s[i//2:i]:
        ans = max(ans, i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def main():
    s = S
    l = len(s)
    while l:
        s = s[:l - 2]
        l = len(s)
        mid = l // 2
        if s[:mid] == s[mid:]:
            ans = l
            break
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def abc():
    s = list(input().rstrip())

    for i in range(len(s)):
        s.pop()
        if len(s) % 2:
            continue
        mid = len(s) // 2
        if s[0:mid] == s[mid:]:
            print(len(s))
            return


abc()

Submission status: Accepted

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

print ('error')

Submission status: Accepted

Solution code:
def check(s):
	if len(s) % 2 == 1:
		return False
	l = len(s)
	return s[:l // 2] == s[-l // 2:]

s = input()
for i in range(300):
	if check(s[:-i - 1]):
		print(len(s) - i - 1)
		break

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

S = sys.stdin.readline().rstrip()
i = 2
while len(S) - i > 0:
    l = len(S) - i
    if S[:l // 2] == S[l // 2:l]:
        print(l)
        break
    i += 2

Submission status: Accepted

Solution code:
s = list(input())
b = [None]*len(s)
for i in range(len(b)):
  s.pop()
  if len(s) % 2 == 0:
    a = int(len(s) / 2)
    if s[:a] == s[a:]:
      print(len(s))
      break
    else:
      continue
  else:
    continue

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

l = len(S) - 1

if l % 2:
    l -= 1

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

print(i)

Submission status: Accepted

Solution code:
def is_even(S):
  L = len(S)
  left = S[:L//2]
  right = S[L//2:]
  return (left == right)

S = list(input())
# 消すのは末尾から

answer = 0
while S:
  S.pop()
  if is_even(S):
    answer = len(S)
    break

print(answer)

Submission status: Accepted

Solution code:
s=input()
x=len(s)

while x>0:
    x=x-2
    s=s[:x]
    s1=s[:int(x/2)]
    s2=s[int(x/2):]

    if s1==s2:
        print(x)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
line = input()
length = len(line)

while length > 0:
    length = length - 2
    a = line[:int(length/2)]
    b = line[int(length/2):length]
    if a == b:
        break

print('{}'.format(length))

Submission status: Accepted

Solution code:
def is_gu(S):
    A = S[(len(S)/2):]
    B = S[:-1*(len(S)/2)]
    if A == B:
        return True
    else:
        return False

S = raw_input()

while len(S) > 1:
    S = S[:-1]
    if len(S) % 2 == 0 and is_gu(S):
        ans = len(S)
        break

print str(ans)

Submission status: Accepted

Solution code:
def main():
    S = input()  # 2<= |S| <= 200, あらっぽい事ができる

    while True:
        S = S[:-1]
        if len(S) % 2 == 0:
            center = int(len(S)/2)
            if S[center:] == S[:center]:
                break

    print(len(S))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = str(input())

ans = 0

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

ans = len(check_str)
print(ans)

Submission status: Accepted

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


for i in range(len(s) // 2):
    f = True
    for j in range(len(s) // 2):
        if s[j] != s[len(s) // 2 + j]:
            f = False
    if f:
        break

    s = s[:-2]

print(len(s))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = input()
tmp = s[:]

for i in range(len(s)):
    guu = len(tmp) // 2
    if i >= 1 and tmp[:guu] == tmp[guu:]:
            print(len(tmp))
            break
    tmp = tmp[:len(tmp)-1]

Submission status: Accepted

Solution code:
S = input()

def is_even_string(S):
    if len(S) % 2 == 1:
        return False
    return S[:len(S) // 2] == S[len(S) // 2:]

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

Submission status: Accepted

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

#残り文字数
lest = len(S)

while 1:
  if lest % 2 == 1:
    lest -= 1
    S = S[:lest]
    continue
  if S[:lest//2]==S[lest//2:]:
    print(lest)
    exit()
  else:
    lest -= 2
    S = S[:lest]

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()

flag=True
a = a[0:len(a)-2]
while(flag):
    #print(a[0:len(a)//2],a[len(a)//2:])
    if a[0:len(a)//2]==a[len(a)//2:]:
        print(len(a))
        flag=False
    else:
        a = a[0:len(a)-2]

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def is_even_str(s):
    mid = len(s) // 2
    for i in range(mid):
        if s[i] != s[mid + i]:
            return False
    return True


S = input()

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

for stop in range(len(S), 1, -2):
    if is_even_str(S[:stop]):
        print(stop)
        break

Submission status: Accepted

Solution code:
S = input()
S = S[:-1]
def cutstring(s):
    n = len(s)
    if n % 2 == 1:
        return cutstring(s[:-1])
    else:
        if s[:n//2] == s[n//2:]:
            return n
        else:
           return cutstring(s[:-1])
ans = cutstring(S)
print(ans)

Submission status: Accepted

Solution code:
S = input()
max = 0
for i in range(1, len(S)//2):
	flag = True
	for j in range(0, i):
		if S[j] != S[i+j]:
			flag = False
			break
	if flag: max = i*2
print(max)

Submission status: Accepted

Solution code:
s=list(input())
ss=[]
ans=[]
for i in range((len(s)//2)):
    ss.append(s[i])
    if(ss==s[i+1:i+1+len(ss)] and ((len(ss)*2)<len(s))):
        ans.append(len(ss)*2)
print(max(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()
ans=len(s)
def check(m):
  a=len(m)
  if a%2==1:
    return False
  else:
    if s[0:a//2]==s[a//2:a]:
      return True
    else:
      return False
for i in range(len(s)-1,0,-1):
  ans-=1
  if check(s[0:i])==True:
    print(ans)
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

cnt = 0
while True:
    tmp = s.pop()
    cnt += 1
    if cnt%2==0:
        for i in range(len(s)//2):
            if s[i] == s[i+len(s)//2]:
                pass
            else:
                break
        else:
            print(len(s))
            break

Submission status: Accepted

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