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()

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

Submission status: Accepted

Solution code:
s = list(input())
s.pop()

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

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
for i in range(l):
	S.pop()
	l = len(S)
	if (l%2 == 0):
		for j in range(l//2):
			if (S[j] != S[j+(l//2)]):
				break
		else:
			print(l)
			exit()

Submission status: Accepted

Solution code:
def check(s):
    if len(s)%2 != 0:
        return False
    if s[:len(s)//2] == s[len(s)//2:]:
        return True
s = input()
s = s[:-1]
while not check(s):
    s = s[:-1]
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
if len(a)%2 == 0:
    a = a[:-2]
    for i in range(int(len(a)/2)):
        if a[:int(len(a)/2)] ==a[int(len(a)/2):]:
            print(len(a))
            break
        else:
            a = a[:-2]
else:
    a = a[:-3]
    for i in range(int(len(a)/2)):
        if a[:int(len(a)/2)] ==a[int(len(a)/2):]:
            print(len(a))
            break
        else:
            a = a[:-2]

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

s = arr_data[0][0]

cnt = 1

while len(s)-cnt > 0:

    l = (len(s)-cnt)//2
    
    
    if s[0:l] == s[l:len(s)-cnt]:
        
        break
    
    
    cnt += 1
    
    
print(l*2)

Submission status: Accepted

Solution code:
def judge(s):
	a = s[0:len(s)/2]
	b = s[len(s)/2:len(s)]
	if a == b: return False
	else: return True

S = raw_input()
S = S[0:len(S)-2]
while judge(S):
	S = S[0:len(S)-2]

print len(S)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_list = list(input())
for i in range(len(str_list)):
    str_list.pop()
    if len(str_list) % 2==0:
        if str_list[:(int(len(str_list)/2))] == str_list[-(int(len(str_list)/2)):]:
            print(len(str_list))
            break
        else:
            pass
    else:
        pass

Submission status: Accepted

Solution code:
print((lambda s: [len(t) for t in [s[:i] for i in reversed(range(len(s)))] if (len(t)%2==0 and t[:len(t)//2]==t[len(t)//2:])])(input())[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def even(s):
    return s[0:len(s)//2] == s[(len(s)//2):]

def longest_even(s):
    for i in range(1, len(s)+1):
        if even(s[0:len(s)-i]):
            return(len(s)-i)


if __name__ == '__main__':
    s = input()
    print(longest_even(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def odd(x):
	if len(x)%2==1:
		return False
	else:
		if x[:(len(x)//2)] == x[(len(x)//2):]:
			return True
		else:
			return False

s = input()
num = 0
while True:
	num += 1
	if odd(s[:(len(s)-num)]):
		print(len(s)-num)
		break

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    s = input()
    ss = False

    while ss is False:
        s = s[:-1]
        boundary = int(len(s) / 2)
        forward = s[:boundary]
        backward = s[boundary:]

        if forward == backward:
            print(len(forward * 2))
            ss = True

Submission status: Accepted

Solution code:
S = input()
last = len(S)-1
result = 1
for i in range(len(S)-1):
    if last%2 > 0:
  	    last -= 1
    else:
        half =int(last/2)
        if S[0:half-1] == S[half:last-1]:
            result = last
            break
        else:
            last -= 2
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
ans = []
for i in range(0,len(a)+1):
    for m in range(i+1,len(a)+1):
        b = a[i:m]
        if len(b) % 2 != 0:
            if b[0:len(b)//2] == b[len(b)//2:-1]:
                ans.append(len(b))
try:ans.pop(len(a))
except:ans=ans
print(max(ans)-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
leng=len(s)-1
if(leng%2==1):
  leng-=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
k = 0
for i in range(1, n//2):
  T = S[:2*i]
  flag = 1
  for j in range(i):
    if T[j] != T[i+j]:
      flag = 0
  if flag == 1:
    k = 2*i
print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(len(s))

Submission status: Accepted

Solution code:
S=list(input())

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

print(len(S))

Submission status: Accepted

Solution code:

def foo(s):
    n = len(s)
    for i in range(n-1, 1, -1):
        d, m = divmod(i, 2)
        if m % 2 == 0 and s[:d] == s[d:i]:
            return i

print(foo(input()))

Submission status: Accepted

Solution code:
def main():
    str = input()
    for i in range(len(str)):
        str = str[:-1]
        lengh = len(str)
        lengh_half = int(lengh/2)
        if(lengh%2==0):
            if(str[lengh_half:]==str[:lengh_half]):
                print(len(str))
                break

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
s_num = int(len(s)/2)
for i in range(s_num):
   s_re = s[0:2*i]
   if i!=0 and s_re[0:i] == s_re[i:2*i]:
      ss = len(s_re)

print(ss)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def isSS(s):
    n = len(s) // 2
    s1 = s[0:n]
    s2 = s[n:]
    return s1 == s2

s = input()

for _ in range(len(s)):
    s = s[:len(s)-1]
    if isSS(s):
        print(len(s))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def chunked(iterable, n):
    return [iterable[x:x + n] for x in range(0, len(iterable), n)]

s=input()
for i in range(1,len(s)):
    a=s[:(-1*i)]
    if len(a)>1:
        li=chunked(a,(len(a)+1)//2)
        
        if li[0]==li[1]:
            print(len(a))
            quit()

Submission status: Accepted

Solution code:
s=list(input())
while True:
    del s[-1:-3:-1]
    med=len(s)//2
    if s[0:med]==s[med:len(s)+1]:
        
        break
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# main関数
if __name__ == '__main__':

    S = input()
    ans = 0



    for t in range(0, len(S) - 1) :
        if (t % 2 == 0) and S[0: int(t / 2)] == S[int(t / 2) : t] :
            ans = max(t , ans)
    print(ans)

Submission status: Accepted

Solution code:
import re
print(len(re.match(r"(.+)\1",input()[:-1]).group(0)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import math
s = input()
while(1):
	s = s[:-1]
	if  s[0:int((((len(s)-1)/2) ))] == s[int((((len(s)-1)/2) + 1)):-1]:
		break

print(len(s))

Submission status: Accepted

Solution code:
s = raw_input()
for i in range(len(s))[::-1]:
    ts = s[:i]
    if not len(ts) % 2 and ts[:len(ts) / 2] == ts[len(ts) / 2:]:
        print len(ts)
        exit()

Submission status: Accepted

Solution code:
s = input()

def check(s):
    length = len(s)
    if(length % 2 == 1):
        return False
    for i in range(int(length / 2)):
        if(s[i] != s[i + int(length / 2)]):
            return False
    return True

count = 0
while(True):
    count += 1
    if(check(s[0:len(s) - count - 1])):
        print(len(s[0:len(s) - count - 1]))
        break

Submission status: Accepted

Solution code:
s = "".join(list(reversed(input())))
n = len(s)

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

Submission status: Accepted

Solution code:
val= list(input())

if val[:int(len(val)/2)] == val[int(len(val)/2):]:
    val.pop()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

S=input()

center=int(len(S)/2-1)

while(True):
    s1=S[0:center]
    s2=S[center:center+center]
    # print("debug","s1:",s1,"s2:",s2)
    if(s1==s2):
        print(len(s1)*2)
        break
    center-=1

Submission status: Accepted

Solution code:
def solve():
    s = list(input())

    while s:
        del s[-1]
        del s[-1]
        pivot = len(s) // 2
        if s[:pivot] == s[pivot:]:
            print(len(s))
            break


solve()

Submission status: Accepted

Solution code:
x = input()
flag = True

for i in range(len(x),0,-1):
    if (i % 2 == 0):
        #print(i, x[0:int(i/2-1)], x[int(i/2 - 1):i-2])
        if (x[0:int(i/2-1)] == x[int(i/2 - 1):i-2] and flag):
            print(i-2)
            flag = False
        else:
            pass
    else:
        pass

Submission status: Accepted

Solution code:
s = raw_input()
l = len(s)
s = s[:l-1]
l -= 1

def thisIsIt(s):
    l = len(s)
    if l%2 == 1:
        return False
    u = s[:l/2]
    b = s[l/2:]
    if u == b:
        return True

while 0 < l:
    if thisIsIt(s):
        print l
        exit()
    s = s[:l-1]
    l -= 1

Submission status: Accepted

Solution code:
S = str(input())
L = S
if (len(S)%2) != 0:
    L = S[:-1]
l = len(L)

for i in range(1, int(l/2)):
    j = -int(2*i)
    K = L[:j]
    p = int(len(K)/2)
    if (K[:p] == K[p:]):
        print(len(K))
        break

Submission status: Accepted

Solution code:
import sys
inp = [x.strip() for x in sys.stdin]
for s in inp:
	lens = len(s)
	for i in reversed(xrange(0, lens, 2)):
		news = s[:i]
		lennews = len(news)
		if lennews % 2 == 0 and news[:lennews/2] == news[lennews/2:]:
			print lennews
			break

Submission status: Accepted

Solution code:
S = list(input())


def check(i):
    if i % 2 == 0:
        return False

    first = S[:i // 2 + 1]
    tail = S[i // 2 + 1:i + 1]
    return "".join(first) == "".join(tail)


N = len(S) - 2
ans = -1
for i in range(N):
    if check(i):
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
S = raw_input()
n = len(S)
for i in xrange(1, n):
    if (n - i)%2 > 0: continue
    T = S[:-i]
    if T[:len(T)/2] == T[len(T)/2:]:
        print n - i
        break

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check_gu(s):
    n = len(s)
    if n%2!=0:
        return False
    return s[:n//2] == s[n//2:]

if __name__ == '__main__':
    s=input()

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

Submission status: Accepted

Solution code:
S = list(input())
while True:
    S.pop()
    if len(S) % 2:
        continue
    else:
        length = len(S) // 2
        if S[:length] == S[length:]:
            print(len(S))
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for i in range(1, N):
    T = S[:-i]
    if len(T) % 2 != 0:
        continue
    M = len(T)
    T1 = T[:M//2]
    T2 = T[M//2:]
    if T1 == T2:
        print(M)
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://abc066.contest.atcoder.jp/tasks/abc066_b

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    txt = input().strip()
    txt = txt[:-1]
    # print(txt)
    result = 0
    if len(txt) % 2 == 1:
        txt = txt[:-1]
    while txt:
        l = len(txt)
        a_part = txt[:l//2]
        b_part = txt[l//2:]
        if a_part == b_part:
            result = l
            break
        txt = txt[:-2]
    print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

    ans -= 2

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
S = input()
sub = ""
for i in range(1,len(S)):
    sub = S[0:len(S)-i]
    a = sub[0:len(sub)//2]
    b = sub[len(sub)//2:len(sub)]
    if a == b:
        print(len(sub))
        break

Submission status: Accepted

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

    length = None
    for i in range(1, len(s)-1):
        tmp = s[:len(s)-i]
        if len(tmp)%2 != 0:
            continue
        elif tmp[:len(tmp)//2] == tmp[len(tmp)//2:]:
            length = len(tmp)
            break
    print(length)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
s= s[:-2]
 
while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)+1]
    if s1 == s2:
        print(len(s1)*2)
        break
 
    s = s[:-2]

Submission status: Accepted

Solution code:
s = input()
s= s[:-2]
 
while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break
 
    s = s[:-2]

Submission status: Accepted

Solution code:
def B_ss(x):
    length = 0
    for i in range(len(x) // 2):
        a = x[0:i + 1]
        b = x[i + 1: (i + 1) * 2]
        if a == b and len(a) != len(x) // 2:
            length = len(a) * 2
    return length

s = input()
print(B_ss(s))

Submission status: Accepted

Solution code:
ss = input()
m = 0
for start in range(len(ss)//2):
    for end in range(start, len(ss) - 1):
        if len(ss[start:end]) > 0:
            if ss[start:end] == ss[end:2*end - start]:
                if (2*end - start) < len(ss):
                    m = max(m, 2*len(ss[start:end]))
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
letters = input()
while True:
    not_equal = 0
    length = len(letters)
    letters = letters[:length-1]
    if len(letters) % 2 != 0:
        continue

    if int(len(letters)) % 2 == 0:
        half = int(len(letters)/2 -1)
    else:
        half = int((len(letters)-1)/2)
    i = 0
    while i <= half:
        if letters[i] != letters[i + half + 1]:
            not_equal = 1
            break
        i += 1

    if not_equal == 0:
        print(len(letters))
        break

Submission status: Accepted

Solution code:
import sys

s = input()
cand_string = ''
cand_string_double = ''
for c in s:
    cand_string += c
    cand_string_double = cand_string * 2
    if cand_string_double == s[0:len(cand_string_double)] and len(cand_string_double) != len(s):
        ans = len(cand_string_double)
print(ans)

Submission status: Accepted

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

S = raw_input()

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

Submission status: Accepted

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
s = input()[:-1]
sn = len(s)

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
s = s[:l-1]
h = int(l / 2)

for i in range(len(s)):
    if l % 2 == 0:
        h = int(l / 2)
        a = s[:h]
        b = s[h:l]
        if a == b:
            print(l)
            break
    l -= 1

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
N = len(s)

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

Submission status: Accepted

Solution code:
S = str(input())
S = S[:-1]
 
hantei = False
while hantei == False:
    if len(S) % 2 == 1:
        S = S[:-1]
    else:
        half = int(len(S)/2)
        last = int(len(S))
        if S[0:half] == S[half:last]:
            print(last)
            hantei = True
        else:
            S = S[0:-1]

Submission status: Accepted

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

hantei = False
while hantei == False:
    if len(S) % 2 == 1:
        S = S[:-1]
    else:
        half = int(len(S)/2)
        last = int(len(S))
        if S[0:half] == S[half:last]:
            print(last)
            hantei = True
        else:
            S = S[0:-1]

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8

def is_even(s):
    return s[:int(len(s)/2)] == s[int(len(s)/2):]

ss = input()
diff = 2
while True:
    if is_even(ss[:len(ss) - diff]):
        break
    else:
        diff += 2

print(len(ss) - diff)

Submission status: Accepted

Solution code:
s = input()[:-2]
half = len(s)//2

for i in range(half):
    t_h = len(s)//2
    if s[:t_h] == s[t_h:]:
        print(len(s))
        break
    else:
        s = s[:-2]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

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

Submission status: Accepted

Solution code:
S = input()
while len(S) != 0:
    S = S[:len(S)-1]
    if len(S)%2 != 0:
        continue
    th = len(S)//2
    if S[:th] == S[th:]:
        print(2*len(S[:th]))
        break

Submission status: Accepted

Solution code:
import sys


def check(line):
    for i in xrange(len(line) / 2):
        if line[i] != line[i + len(line) / 2]:
            return False
    return True

line = sys.stdin.readline().rstrip()
for i in xrange(2, len(line), 2):
    substr = line[:len(line) - i]
    if check(substr):
        print len(substr)
        break

Submission status: Accepted

Solution code:
def ss(st):
    flag = True
    
    if len(st) % 2 != 0:
        flag = False
    else:
        n = len(st) // 2
        for i in range(n):
            if st[i] != st[i+n]:
                flag = False
                break
    return flag

S = input()
for i in range(len(S)-1, 0, -1):
    temp = S[0:i]
    if ss(temp):
        print(len(temp))
        break

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print(len(data))
                break

Submission status: Accepted

Solution code:
s=raw_input()
for j in range(len(s)-1,-1,-1):
    p=s[:j]
    if len(p)%2==0:
        s1=p[:len(p)/2]
        s2=p[len(p)/2:]
        if s1==s2:
            print j
            exit()

Submission status: Accepted

Solution code:
s = input()

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


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break

    s = s[:-2]

Submission status: Accepted

Solution code:
s = raw_input()
i = len(s) - 2
while(len(s)):
    if i % 2 == 0 and s[0:i/2] == s[i/2:i]:
        print i
        break
    i-=1

Submission status: Accepted

Solution code:
S = raw_input()

rel = 0

for i in range(len(S)/2 - 1):
    s1 = S[0:i]
    s2 = S[i + 1:i + i + 1]
    if s1 == s2:
        rel = 2 * (i + 1)

print rel

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = input()
length = len(string)
for i in range(length):
    if (length-(i+1))%2 == 0:
        if string[0:int((length-(i+1))/2)] == string[int((length-(i+1))/2):length-(i+1)]:
            print(length-(i+1))
            break

Submission status: Accepted

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

import re

x = raw_input()

num = list(x)

for i in range(len(x)):
        tmp = len(x) - i
        if (tmp % 2 == 0):
                first = x[0:tmp/2]
                second = x[tmp/2:-i]
                if (first == second):
                        print tmp
                        exit(0)

Submission status: Accepted

Solution code:
s = input()
for n in reversed(range(len(s)-1)):
    if s[0:n//2] == s[n//2+1:n]:
        print(n+1)
        break

Submission status: Accepted

Solution code:
import copy, sys
S = input()
s = copy.deepcopy(S)
for i in range(int(len(S)/2)) :
    s = s[:-2]
    s1 = s[0:int(len(s)/2)]
    s2 = s[int(len(s)/2):int(len(s))]

    if s1 == s2:
        print(len(s))
        sys.exit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
a = input()
ind = len(a)
while True:
    a = a[0:ind-1]
    b = a[0:ind//2]
    c = b+b
    if a==c:
        print(len(c))
        break
    ind = len(a)

Submission status: Accepted

Solution code:
import sys

S = input()
n = 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)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
def iseven(str, n):
    for i in range(0, n//2):
        if str[i] != str[i+n//2]:
            return False
    else:
        return True


for i in range(2, n, 2):
    if iseven(s, n-i):
        print(n-i)
        break

Submission status: Accepted

Solution code:
def even(s):
    if len(s) % 2 != 0: return False
    a = s[:len(s)//2]
    return 2*a == s

s = list(input())
s.pop()
while not even(s): s.pop()
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# !/usr/bin/env python
# -*- coding utf-8 -*-

import sys

S = raw_input()

S = S[:-1]

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

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

Submission status: Accepted

Solution code:
# encoding:utf-8
S = input()

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

Submission status: Accepted

Solution code:
#s = list(input())
s = input()
n = len(s)
count = 1   #消した数
 
if n % 2 == 1 - count:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
print(n-count)

Submission status: Accepted

Solution code:
def f(x):
    return len(x) % 2 == 0 and x[:len(x)//2] == x[len(x)//2:]
 
x=input()[:-1]
while not f(x):
    x=x[:-1]
 
print(len(x))

Submission status: Accepted

Solution code:
str=input()
k=len(str)
str=str[0:k-2]
while True:
    n=int(len(str)/2)
    a=str[:n]
    b=str[n:]
    if a==b:
        print(len(a)*2)
        break
    k=len(str)
    str=str[0:k-2]

Submission status: Accepted

Solution code:
S = input()


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


def mirror_string_length(str):
    s = str[0:-1]
    while len(s):
        if is_mirror_string(s):
            return len(s)
        else:
            s = s[0:-1]
    return 0


print(mirror_string_length(S))