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

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

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

Solution (Python):

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

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

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

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

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

Solution (Python):


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

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

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

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

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

Solution (Python):

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)

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

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

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

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

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

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

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

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

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

Solution (Python):


S=input()

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

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

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

Solution (Python):
x = input()
flag = True

for i in range(len(x),0,-1):
    if (i % 2 == 0):
        
        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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

"""
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]
    
    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:])

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

Solution (Python):
S = input()

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

    ans -= 2

print(ans)

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

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

Solution (Python):
s = input()

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

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

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

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

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

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

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

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

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

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

Solution (Python):


S = raw_input()

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

Solution (Python):


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

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

Solution (Python):

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

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

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

Solution (Python):
S = input()

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

Solution (Python):


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)

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):


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)

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

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

Solution (Python):


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:]

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

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

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

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

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

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

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

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

Solution (Python):



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

Solution (Python):

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

Solution (Python):

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)

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

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

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

Solution (Python):
st=input()
num=len(st)
for x in range(1,num+1):
    st = list(st)
    del st[-1:]
    st = "".join(st)
    n=len(st)
    if n%2==0:
        p=int(n/2)
        st1=st[:p]
        st2=st[-p:]
        if st1==st2:
            print(len(st))
            break
        else:
            continue
    else:
        continue

Solution (Python):


import sys
import subprocess
import json
import time
import math
import re
import sqlite3

def ok(S):
    if len(S) % 2 != 0: return False
    for i in range(len(S) // 2):
        if S[i] != S[len(S) // 2 + i]: return False
    return True

S = input()
for i in range(1, len(S)):
    if ok(S[:-i]):
        print(S[:-i], file=sys.stderr)
        print(len(S[:-i]))
        break

Solution (Python):
S = raw_input()
flag = 0
S = S[:-1]
while(len(S) > 0):
  if len(S) % 2 == 1:
     S = S[:-1]
  else:
     a = S[:len(S)/2]
     b = S[len(S)/2:]
     if a == b:
        ans = S
        break
     S = S[:-1]
print len(S)

Solution (Python):
S =input()
ans=len(S)-2
while S[:int(ans/2)]!=S[int(ans/2):int(ans)]:
        ans = ans-2
print(ans)

Solution (Python):
def find_even(text):
    chars = list(text)
    tail_index = (len(chars) + 1) // 2
    pre = 0
    while tail_index > 0:
        tail_index -= 1
        pre = 0
        post = tail_index
        while chars[pre] == chars[post]:
            pre += 1
            post += 1
            if pre == tail_index:
                return 2 * tail_index
    raise("Error")

if __name__ == "__main__":
    
    print(find_even(raw_input()))

Solution (Python):
def solve(s):
    L = len(s)
    L -= 1
    if L % 2 == 1:
        L -= 1
    while L >= 2:
        if s[:L/2] == s[L/2:L]:
            return L
        L -= 2
    return 0


def main():
    s = raw_input().rstrip()
    print solve(s)


if __name__ == '__main__':
    main()

Solution (Python):
data=list(map(str,input()))
del data[-1]
while len(data):
    m = len(data)//2
    if data[:m]==data[m:]:
        print(len(data))
        break
    del data[-1]
else:
    print(0)

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

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

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

Solution (Python):
S = raw_input()
n = len(S)

ans = 0
for k in range((n+1)/2):
    if S[:k] == S[k:2*k]:
        ans = k * 2
print ans

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    s = S()
    e = set()
    r = len(s)
    for i in range(r-2,-1,-2):
        if s[:i//2] == s[i//2:i]:
            return i
    return -1


print(main())

Solution (Python):
s = input()

length = len(s) - 2

def guumoji(s):
    length = len(s)

    if s[:length//2] == s[length//2:]:
        return True

    return False

while length > 0:
    if guumoji(s[:length]):
        break

    length -= 2

print(length)

Solution (Python):
if(__name__ =="__main__"):
    S = input()
    for i in range(1,len(S)):
        tmp = S[:-i]
        tmplen = len(tmp)
        
        if(tmplen % 2 == 0):
            
            if(tmp[:int(tmplen/2)] == tmp[int(tmplen/2):]):
                print(tmplen)
                break

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

Solution (Python):


s=raw_input()
if len(s)%2:
 s1=s[:-1]
else:
 s1=s[:-2]
while len(s1)>0:
 l=len(s1)
 if s1[:l/2]==s1[l/2:]:
  print l
  break
 s1=s1[:-2]

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

Solution (Python):
string = input()

if len(string)%2==0 :
    string = string[:-2]
else :
    string = string[:-3]
length = len(string)

while length>0 :
    if string[:length//2]==string[length//2:] :
        print(length)
        break
    length -= 2
    string = string[:-2]

Solution (Python):
s = list(input())
for i in range(int(len(s)/2)-1):
    s = s[:-2]
    sep = int(len(s)/ 2)
    a = s[:sep]
    b = s[sep:]
    if a == b:
        print(int(len(a)*2))
        break

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


length = len(S)


while S[:int(length / 2)] != S[int(length / 2):]:
      S = S[:-2]
      length = len(S)

      if length == 0:
          breaek

print(length)

Solution (Python):
def isEvenstring(s):
	l = len(s)
	center = int(l/2)
	if l%2 == 0:
		return s[:center]==s[center:]

	else:
		return False




if __name__ == '__main__':
	string = input()
	l = len(string)
	for i in range(1, l):
		if isEvenstring(string[:-i]):
			print (l - i)
			break

Solution (Python):
s = input()

while True:
    s = s[:-1]
    L = len(s)
    if L%2 != 0:
        continue

    ok = True
    for i in range(L//2):
        if s[i] != s[L//2+i]:
            ok = False
    if ok:
        break

print(len(s))

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

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

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

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

i=0
L=[]

for i in range(len(s)):
    
    
    if s[0:i]==s[i:(2*i)]:
        L.append(2*i)
    
print(max(L))

Solution (Python):




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



def check(s):
    if len(s) % 2 == 1:
        return False
    if (s[:int(len(s)/2)] == s[int(len(s)/2):]):
        return True
    else:
        return False



while (len(S) > 0):
    if check(S):
        print(len(S))
        break
    else:
        S = S[:-1]

Solution (Python):
from sys import stdin
s = stdin.readline().strip()
n = len(s)
n-=2
while True:
 if s[:n/2]== s[n/2:n]:
  break
 n-=2
print n

Solution (Python):
print(len(__import__("re").search(r"(.+)\1", input()[:-1]).group(0)))

Solution (Python):
s = input()

for i in range(len(s)):
    s = s[:-1]
    if len(s) % 2 == 1:
        continue
    ss = s[len(s)//2:]
    flag = True
    for j in range(len(ss)):
        if ss[j] != s[j]:
            flag = False
            break
    if flag:
        print(len(s))
        break
    s = s[:-1]

Solution (Python):
a = list(input())
flag = True

a = a[:-1]
while(flag):
    flag = False
    if len(a)%2!=0:
        a = a[:-1]
        flag = True
        continue
    if a[0:len(a)//2]!=a[len(a)//2:]:
            a = a[:-1]
            flag = True



print(len(a))

Solution (Python):


import numpy as np

if __name__=="__main__":
    s = input().replace("\n", "")
    n = len(s)
    ss = ""
    if n%2 == 1:
        s = s[0:n-1]
        n = len(s)
    elif n%2 == 0:
        s = s[0:n-2]
        n = len(s)

    for i in list(range(0,n,2)):
        ss = s[0:n-i]
        m = len(ss)
        if ss[0:int(m/2)] == ss[int(m/2):m]:
            print(len(ss))
            break

Solution (Python):
S = input()

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

flag = 0
while flag == 0:
    S = S[:-2]
    ans = int(len(S) / 2)
    same_char = 0
    i = 0
    while i < ans:
        if S[i] == S[ans + i]:
            same_char += 1
        else:
            break
        i += 1
    if ans == same_char:
        flag = 1

print(len(S))

Solution (Python):
def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0
S = list(input())
length = len(S)
flag = 0
if length == 2:
    print(0)
    flag = 1
elif length == 3:
    length -= 1
    ans = hantei(S,2)
    print(ans)
    flag = 1
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0
while length >= 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if flag == 0:
    if ans == 0:
        print(1)
    else:
        print(ans)

Solution (Python):
c=0
i=0
list1=[]
list2=[]


S = input('')
char_list = list(S)
c = len (char_list)
c= c-1


while c>1:
	if c % 2 == 0:
		d=int(c/2)
		
		for i in range(d):
			list1.append(char_list[i]) 
			list2.append(char_list[i+d])
		
		

		if list1 == list2:
			print (len (list1)*2)
			break

		list1=[]
		list2=[]
	c=c-1

Solution (Python):
import sys

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

Solution (Python):
s=input()

n=len(s)

def isok(s):
    n=len(s)
    if n%2==0:
        m=int(n/2)
        if s[0:m]==s[m:n]: return True
    return False

for i in range(n-1,0,-1):
    s=s[0:i]
    if isok(s): print(i) ; break

Solution (Python):
string = list(input())
string.pop()
string.pop()
while "".join(string[:len(string) // 2]) != "".join(string[len(string) // 2:]):
	
	string.pop()
	string.pop()

print(len(string))

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


for i in range(len(ss)):
    chrnum = int(len(ss))- i
    
    if chrnum % 2 == 0:
        
        
        if ss[0:int(chrnum/2)] == ss[int(chrnum/2) : chrnum]:
            print (chrnum)
            exit()