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()
ns=s

def check_even_string(ss):
  l=int(len(ss)/2)
  return ss[l:]==ss[:l]

while True:
  ns=ns[:-2]
  if check_even_string(ns):
    break

print(len(ns))

Solution (Python):

import sys

s = input()
s = list(s)

s.pop()
while(len(s) >= 2):
    if(s[:int(len(s)/2)] == s[int(len(s)/2):]):
        print(len(s))
        sys.exit()
    else:
        s.pop()

Solution (Python):
from sys import stdin


def main() -> int:
    s = next_str()
    cnt = 0

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

    print(cnt)
    return 0


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
S.pop(len(S) - 1)
count = 0
while True:
    if len(S) % 2 != 0:
        S.pop(len(S) - 1)
        continue
    mid = int(len(S) / 2)
    for i in range(mid):
        if S[i] == S[i + mid]:
            count += 1
    else:
        if count == mid:
            print(len(S))
            break
        else:
            count = 0
            S.pop(len(S) - 1)

Solution (Python):
s = input()
for i in range(len(s)):
    str = s[:-(i+1)]
    str_half_length = int(len(str) / 2)
    str_1 = str[str_half_length:]
    str_2 = str[:str_half_length]
    if str_1 == str_2:
        print(str_half_length * 2)
        exit()

Solution (Python):
S = list(input())
S.pop(len(S) - 1)
count = 0
while True:
    if len(S) % 2 != 0:
        S.pop(len(S) - 1)
        continue
    mid = int(len(S) / 2)
    for i in range(mid):
        if S[i] == S[i + mid]:
            count += 1
    else:
        if count == mid:
            print(len(S))
            break
        else:
            count = 0
            S.pop(len(S) - 1)

Solution (Python):
def main():
    S = input()
    counter = len(S)

    while True:
        
        if counter%2 == 1:
            counter-=1
            continue
        if S[0:counter//2] == S[counter//2:counter] and counter!=len(S):
            break

        counter-=1
    
    print(abs(counter))

main()

Solution (Python):
S = list(input())
S.pop(len(S) - 1)
count = 0
while True:
    if len(S) % 2 != 0:
        S.pop(len(S) - 1)
        continue
    mid = int(len(S) / 2)
    for i in range(mid):
        if S[i] == S[i + mid]:
            count += 1
    else:
        if count == mid:
            print(len(S))
            break
        else:
            count = 0
            S.pop(len(S) - 1)

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

for i in range(len(s)):
	if s[0:i] == s[i:2*i]:
		if (len(s[0:i])*2 != 0 and len(s[0:i])*2 != len(s)) and len(s[0:i])*2 > res:
			res = len(s[0:i])*2
s = s[::-1]
for i in range(len(s)):
	if s[0:i] == s[i:2*i]:
		if (len(s[0:i])*2 != 0 and len(s[0:i])*2 != len(s)) and len(s[0:i])*2 > res:
			res = len(s[0:i])*2

print(res)

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

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

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

Solution (Python):
def is_evenstr(s):
    n = len(s)
    if n%2 == 1: 
        return False
    return s[:n//2] == s[n//2:]

S = input()
while S != "":
    S = S[:-1]
    if is_evenstr(S):
        print(len(S))
        break

Solution (Python):
s=input()

flag = True

i=1
while flag:
  s = s[:-i]
  if len(s)%2==0:
    mid = (len(s)//2 -1)
    if s[mid+1:] == s[:mid+1]:
      print(len(s))
      exit()

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

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

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

s.pop(-1)

if len(s)%2==1:
	s.pop(-1)
q = len(s)
for i in range(q//2):
	a =s[:len(s)//2]
	b =s[len(s)//2:]

	if a==b:
		print(len(a)*2)
		break
	else:
		s.pop(-1)
		s.pop(-1)
else:
	print(-1)

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

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

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

Solution (Python):
s = input()

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

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

Solution (Python):
s = list(input())
i = int((len(s)-3)/2)
while i >= 0:
  if s[0:i] == s[i+1:2*i+1]:
    print(2*(i+1))
    break
  i -= 1

Solution (Python):
s = input()

for i in range(len(s)):
    if i == 0:
        pass

    else:
        tmp = s[0 : len(s) - 2 * i]
        f = tmp[: len(tmp) // 2]
        l = tmp[len(tmp) // 2 :]
        if f == l:
            print(len(tmp))
            exit(0)

Solution (Python):


INF = float('inf')


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


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

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

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

Solution (Python):
s = str(input())
list_s = list(s)
if len(list_s)%2 == 1:
    del list_s[-1]
else:
    del list_s[-1]
    del list_s[-1]

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

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

Solution (Python):

def is_evenstr(s):
    if len(s)%2 != 0:
        return False
    else:
        k = len(s)//2
        s1 = s[:k]
        s2 = s[k:]
        if s1 == s2:
            return True
        else:
            return False

s = input()
while s:
    s = s[:-1]
    if is_evenstr(s):
        print(len(s))
        break

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

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

s = ns()

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

Solution (Python):
def judge(S):
    half = int(len(S)/2)
    if S[:half] == S[half:]:
        return True
    else:
        return False

S= input()
l = len(S)
if l%2 == 1:
    S = S[:-1]
else:
    S = S[:-2]
while S != "":
    if judge(S):
        break
    S = S[:-2]

print(len(S))

Solution (Python):
s = input()

i = 2
while len(s) - i > 0:
    a = s[:len(s)-i]
    b1 = a[:len(a)//2]
    b2 = a[len(a)//2:]
    if b1 == b2:
        print(len(a))
        break
    i += 2

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

Solution (Python):
S = list(input())
l = len(S)
for i in range(l) :
    S.pop(-1)
    if i % 2 != 0 :
        A = S[0:len(S)//2]
        B = S[len(S)//2:len(S)]
        if A == B :
            print(len(S))
            break

Solution (Python):
S=input()

L=len(S)

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

print(i*2)

Solution (Python):
a=input()
if len(a)%2==1:a=a[:-1]
else:a=a[:-2]
while a[0:int(len(a)/2)]!=a[int((len(a)/2)):len(a)]:
  a=a[:-2]
print(len(a))

Solution (Python):
def che(s):
    lens = len(s)
    if s[:lens//2] == s[lens//2:]:
        TF = True
    else:
        TF = False
    return TF

S = input()
TF = False
ind = 0

if len(S)%2 == 1:
    S2 = S[:-2]
else:
    S2 = S[:-2]
while True:
    TF = che(S2)
    if TF == False:
        S2 = S2[:-2]
    else:
        ans = len(S2)
        print(ans)
        exit()

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
ans = 1
while True:
    del S[-1]
    L = len(S)
    if L % 2 == 0:
        if S[:int(L / 2)] == S[int(L / 2):]:
            print(L)
            ans = -1
            break
    if ans == -1:
        break

Solution (Python):
S = input()


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


for i in range(len(S)):
    if check_even(S[:-(i+1)]):
        print(len(S)-(i+1))
        exit()

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

Solution (Python):
S = input()
S = S[:-1]
def judge_odd(S):
    
    temp_len = len(S)/2
    temp_a = S[:int(len(S)/2)]
    temp_b = S[int(len(S)/2):]
    
    
    if temp_a == temp_b:
        return False
    else:
        return True
judge = True
if len(S)%2 != 0:
    S = S[:-1]
while judge:
    judge = judge_odd(S)
    if judge:
        S = S[:-2]
print(len(S))

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()

mid = len(S) // 2 - 1
i = 2
while i < len(S):
  if S[:mid] == S[mid:len(S)-i]:
    print(len(S)-i)
    exit(0)
  
  mid = mid - 1
  i += 2

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

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

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return




dp = None


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


def main():
    S = input()

    for i in range(2, 99999, 2):
        if is_even_str(S[:len(S) - i]):
            print(len(S) - i)
            return


main()

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

Solution (Python):
s=input();
a=(len(s)-1)//2;
while 1:
    f=1;
    for i in range(a):f=f and s[i]==s[a+i]
    if f:
        print(a*2)
        exit()
    a-=1

Solution (Python):
import sys
s=input()
s=list(s)
if len(s)%2==0:
    s.pop(len(s)-1)
    s.pop(len(s)-1)
else:
    s.pop(len(s)-1)

while len(s)>0:
    if s[:int(len(s)/2)]==s[int(len(s)/2):]:
        print(len(s))
        sys.exit()
    s.pop(len(s)-1)
    s.pop(len(s)-1)

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

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

Solution (Python):

s = input()

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

Solution (Python):

s = input()

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

Solution (Python):
s = input()

last = len(s)
mid = last // 2
while last > 0:
    last -= 2
    mid -= 1
    if s[:mid] == s[mid:last]:
        print(last)
        break

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

Solution (Python):


def main():
    s = input()[::-1]

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

if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

while True:
    s = s[:-2]
    i = len(s) // 2

    if s[:i] == s[i:]:
        break

print(len(s))

Solution (Python):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

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

S = input()

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

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

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

Solution (Python):
s = input()
def hoge(s):
    if s[:len(s)//2] == s[len(s)//2:]:
        return 1
    else:
        return 0
ans = len(s)-1
s = s[:-1]
while True:
    if hoge(s):
        print(ans)
        exit()
    s = s[:-1]
    ans -= 1

Solution (Python):
s = input()

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

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

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

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

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

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

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

N=len(S)

for i in range(N-1, -1, -1):
    if i%2==0:
        a=''.join(S[0:i//2])
        b=''.join(S[i//2:i])
        if a==b:
            break

print(i)

Solution (Python):
S = input()

resString = ''

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

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

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

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

Solution (Python):
import sys

s = list(input())

del s[len(s) - 1]

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

  if flag:
    print(len(s))
    sys.exit()
  else:
    del s[len(s) - 1]

Solution (Python):


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

Solution (Python):
"""
https://abc066.contest.atcoder.jp/tasks/abc066_b
"""
s=input()
a=0
for i in range(len(s)):
    if len(s)%2==0 and a!=0 and s[0:int(len(s)/2)]==s[int(len(s)/2):len(s)+1]:
        print(len(s))
        break
    else:
        s=s[0:len(s)-1]
    
    a=a+1

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

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

Solution (Python):


S = input()

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

Solution (Python):

S = input()
 
for i in range(len(S) // 2):
    if S[:i] + S[:i] == S[:2 * i]:
        ans = i
 
print(2 * ans)

Solution (Python):

S = input()

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

print(2 * ans)

Solution (Python):
input_string = input()
input_list = []

for i in input_string:
    input_list.append(i)

if len(input_string) % 2 == 1:
    length = int((len(input_string) - 1)/2)
    input_list.pop()
else:
    length = int((len(input_string) - 2)/2)
    input_list.pop()
    input_list.pop()

while length > 0:
    if input_list[:length] == input_list[length:]:
        print(len(input_list))
        break
    else:
        length -= 1
        input_list.pop()
        input_list.pop()

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

if len(S)%2 != 0:
    S.pop()
else:
    S.pop()
    S.pop()
    
for i in range(len(S)):
    if S[:len(S)//2] == S[len(S)//2:]:
        res = len(S)
        break
    else:
        S.pop()
        S.pop()
print(res)

Solution (Python):
s=input()
n=len(s)
t=0
for i in range(0,n-2,2):
    for j in range(i+2,n,2):
        x=(i+j)//2
        if s[i:x]==s[x:j]:
            if t<j-i:
                t=j-i
print(t)

Solution (Python):
S = input()
i = len(S)//2
while True:
    i -= 1
    if S[:i] == S[i:i*2]:
        print(i*2)
        exit()

Solution (Python):
S = input()
i = -1
while(True):
    s = S[:i]
    if len(s)%2 != 0:
        i -= 1
        continue

    s1 = s[0:len(s)//2]
    s2 = s[len(s)//2:]
    if s1 == s2:
        print(len(s))
        exit()
    i -= 1

Solution (Python):
s = list(input())
for i in range(1,len(s)):
    del s[-1]
    l = len(s)
    m = int(l/2)
    if l % 2 == 1:
        pass
    elif s[:m] == s[m:]:
        break
print(len(s))

Solution (Python):
s = input()
n = len(s)
check = True
i = 2
while check:
    if s[0:(n-i)//2] == s[(n-i)//2:(n-i)]:
        check = False
    else:
        i += 2
print(n-i)

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

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

Solution (Python):
S = input()

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

length = len(S)

notsame = True

while notsame:
    half = int(length/2)
    left = S[0:half]
    right = S[half:length]
    if right == left:
        notsame = False
        print(length)
    else:
        S = S[:-2]
        length = len(S)

Solution (Python):
s=input().strip()

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

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

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

Solution (Python):
s = input()
if len(s) % 2 != 0:
    s = s[:-1]
else:
    s = s[: -2]
flag = False
while not flag:
    m = len(s) // 2
    if s[:m] == s[m:]:
        flag = True
    else:
        s = s[:-2]

print(len(s))

Solution (Python):
def f(a):
    return a[:len(a) // 2] == a[len(a) // 2:]

a = input()[:-1]
while a:
    if f(a):
        print(len(a))
        exit()
    else:
        a = a[:-1]
print(0)

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

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

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

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

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

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

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

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

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

Solution (Python):
S = input()

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):





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

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

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

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

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

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

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

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

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