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()
tmp = s[:]

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

Solution (Python):
S = input()

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

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

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


lest = len(S)

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

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

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

Solution (Python):
a = input()

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

Solution (Python):
s = input()

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

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


S = input()

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):


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

Solution (Python):
from sys import exit, stdin
S = stdin.readline().rstrip()
len_S = len(S)
for i in range(int(len_S/2)-1, 0, -1):
    if S[:i]+S[:i] == S[:i*2]:
        print(i*2)
        exit()

Solution (Python):
s = input()
s = s[:-1]
if len(s) % 2 == 1:
    s = s[:-1]
for i in range(len(s) // 2):
    f = True
    for j in range(len(s) // 2):
        if s[j] != s[len(s) // 2 + j]:
            f = False
    if f:
        break
    s = s[:-2]

print(len(s))

Solution (Python):
S = input()

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

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

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

print(len(S))

Solution (Python):
import sys
s = input()
s = s[:len(s)-1]
while 1:
    if len(s) %2 == 1:
        s = s[:len(s)-1]
        continue

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

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

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

Solution (Python):
s = input()
s_list = []

for i in s:
    s_list.append(i)
del s_list[-1]

while True:
    s_half = int(len(s_list)/2)
    s1 = s_list[:s_half]
    s2 = s_list[s_half:]
    if s1 == s2:
        print(s_half*2)
        break
    else:
        del s_list[-1]

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

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

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

while True:
    m = len(S)
    S = S[:m - 2]
    if not S:
        print(1)
        exit()
    m = len(S)
    if S[:int(m / 2)] + S[:int(m / 2)] == S:
        print(len(S))
        exit()

Solution (Python):

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    s = input()
    for i in range(1, len(s) - 1):
        new_s = s[:len(s) - i]
        if len(new_s) % 2 != 0:
            continue
        front = new_s[:len(new_s) // 2]
        back = new_s[len(new_s) // 2:]
        if front == back:
            print(len(new_s))
            exit()


if __name__ == '__main__':
    main()

Solution (Python):
def isEvenString(s):
  if s[0:len(s)//2]==s[len(s)//2:]:
    return True
  return False

s=input()
for z in range(2,len(s)+1,2):
  if isEvenString(s[0:len(s)-z]):
    ans=len(s)-z
    break

print(ans)

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

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

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

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

Solution (Python):


def solve():
    S = input()
    for i in range(1, len(S)):
        s = S[:-i]
        if len(s)%2 != 0: continue 
        
        pivot = len(s)//2
        upper = s[0:pivot]
        lower = s[pivot:]

        if upper == lower:
            print(len(s))
            return

if __name__ == "__main__":
    solve()

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

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

Solution (Python):
from collections import Counter
s=input()
for i in range(len(s)-1, -1, -1):
	if i % 2 == 1:
		continue
	if s[:i//2] == s[i//2:i]:
		print(i)
		break

Solution (Python):
S = input()

S_len = len(S)
if S_len % 2 == 0:
    base = 2
else:
    base = 1

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

Solution (Python):
s = input()
for i in range((len(s) - 1) // 2 * 2,0,-2):
	if s[: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:]:
    print(len(S))
    exit()

Solution (Python):
import re
s=input()[:-1]
ans=re.match(r'(.+)\1',s).group()
print(len(ans))

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

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

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

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

Solution (Python):

S=input()

while True:
  
  S=S[:-2]

  if S[:len(S)//2]==S[len(S)//2:]:
    print(len(S))
    exit()

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

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

print(len(s))

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

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

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

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

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

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

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

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

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

Solution (Python):
x = input()
l = (len(x)-1)//2

for i in range(l,0,-1):
  if x[:i] == x[i:i+i]:
    print(i+i)
    break

Solution (Python):
S = list(input())
l = len(S)
i = l - 2
while 2 <= i:
    flag = True
    k = i//2
    for j in range(0,k):
        if S[j] != S[j+k]:
            flag = False
            break
    if flag:
        print(i)
        exit()
    i -= 2

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

ans = 0
num = 0
while num < len(S):
  num += 1
  s = S[:len(S)-num]
  if len(s) % 2 == 0:
    if s[:int(len(s)/2)] == s[int(len(s)/2):]:
      ans = len(s)
      break
print(ans)

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

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

Solution (Python):

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

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

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

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

Solution (Python):
s = input()

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

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

for i in range(1,len(s)):
    len_s = len(s) - 2 * i
    for j in range(1,len(s)):
        left = s[0:j]
        right = s[j:len_s]
        if left == right:
            ans = len(left + right)
            print(ans)
            exit()
        elif len(left) > len(right):
            break

Solution (Python):
s = input()
def guu(t):
    if len(t) % 2 == 1:
        return False
    return t[:len(t)//2] == t[len(t)//2:]
for i in range(len(s)-1, 0, -1):
    if guu(s[:i]):
        ans = len(s[:i])
        break
print(ans)

Solution (Python):
S = input()

n = len(S) // 2

i = 1
while True:
    if S[:n-i] == S[n-i:2*(n-i)]:
        print(2*(n-i))
        break
    i += 1

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

Solution (Python):


def solve(s):
  n = len(s)
  if s[:n//2] == s[n//2:n]:
    return n
  else:
    return solve(s[:-2])


if __name__ == "__main__":
  s = str(input())
  print(solve(s[:-2]))

Solution (Python):
s = input()

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

for i in range(1, len(s)):
    if is_odd_string(s[:-i]):
        print(len(s[:-i]))
        exit()

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

Solution (Python):

lst = list(input())
for i in range(len(lst) // 2):
    lst = lst[: -2]
    if lst[: len(lst) // 2] == lst[len(lst) // 2 :]:
        break
print(len(lst))

Solution (Python):

lst = list(input())
for i in range(len(lst)):
    lst.pop()
    length = len(lst)
    if length % 2 == 1:
        continue
    elif lst[: length // 2] == lst[length // 2 :]:
        break
print(length)

Solution (Python):
import sys
from collections import Counter

s = input()

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

Solution (Python):

def read_input():
    s = input()
    return s

def check_even_string(s):
    if len(s) % 2:
        return False

    mid = len(s)//2
    if s[:mid] == s[mid:]:
        return True

    return False


def submit():
    s = read_input()

    for i in range(1, len(s)):
        if check_even_string(s[:-i]):
            print(len(s[:-i]))
            return

if __name__ == '__main__':
    submit()

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

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

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

Solution (Python):
S = input()

for i in range(len(S)):
    s = S[:len(S)-1-i]
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        quit()
print(0)

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math

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


s = str(input())

for i in reversed(range(1,len(s))):
    
    if check(s[:i]):
        print(len(s[:i]))
        exit()

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

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def is_even(s):
    slen = len(s)
    halflen = slen//2
    for i in range(halflen):
        if s[i] != s[i+halflen]:
            return False
    
    return True

def solve():
    s = input()
    slen = len(s)
    for i in range(slen-2, 0, -2):
        if is_even(s[0:i]):
            print(i)
            break




solve()

Solution (Python):
S = input()
N = len(S)
c = 0
for i in range(N-1):
  tmp = S[:i+1]
  if len(tmp) % 2 == 1:
    continue
  n = len(tmp) // 2
  if tmp[:n] == tmp[n:] and n > c:
    c = n
print(c*2)

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

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

Solution (Python):
S = input()

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

for i in range(len(S)-1, 0, -1):
    if check(S[:i]):
        ans = len(S[:i])
        break

print(ans)

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

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

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

print(len(S))

Solution (Python):
s=input()
while 1:
    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)-1):
    l = len(s[:-i])
    if l % 2 != 0:
        continue
    else:
        if s[:int(l/2)] == s[int(l/2):-i]:
            print(l)
            break
        else:
            continue

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    INF = float("inf")
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    S = list(_ for _ in input())
    ans = 1

    for i in range(len(S)):
        if(len(S)%2 == 1 or i ==0):
            S.pop(len(S)-1)
            continue
        mid = len(S)//2

        if(S[:mid] == S[mid:]):
            ans = len(S)
            break
        S.pop(len(S)-1)
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
S = input()

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

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

Solution (Python):
s = input()

moji  = list(s)
ans = 0
for n in range(len(moji) // 2):
  parts  = "".join(moji[:n+1])
  check = "".join([parts,parts])
  if check == "".join(moji[:(n+1)*2]) and len(check) != len(s):
    
    ans = (n+1)*2
    
print(ans)

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

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

Solution (Python):
S = input()

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

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

Solution (Python):
S = input()

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

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

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

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

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

Solution (Python):
S = input()
s = list(S)
s_len = len(S)

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

Solution (Python):
import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

s = ns()
n = len(s)
for i in range(n):
    s = s[:-1]
    if len(s) % 2 == 0:
        m = len(s) // 2
        count = 0
        for j in range(m):
            if s[j] == s[j + m]:
                count += 1
        if count == m:
            print(2 * m)
            exit()

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

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

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

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

Solution (Python):
n = input()

n = n[:-1]

while n[:len(n)//2] != n[len(n)//2:]:
  n = n[:-1]

print(len(n))

Solution (Python):
S=list(input())
l=len(S)
for i in range(1,l//2):
	if all([S[j]==S[j+i] for j in range(i)]):
		ans=2*i
print(ans)

Solution (Python):
s = input()
found = 0
for i in range(len(s)):
    if i % 2 == 0 and i >= 2:
        t = s[:i//2]
        t2 = s[i//2:i]
        if t == t2:
            found = i
print(found)

Solution (Python):
import sys
s = str(raw_input())
for i in range(len(s)-2, 0, -2):
	if s[:i/2] == s[i/2:i]:
		print i
		sys.exit()

Solution (Python):
def f(s):
  l=len(s)
  if l%2==0:
    return s[:l//2]==s[l//2:]
s=input()
L=len(s)
for i in range(1,L):
  a=s[:L-i]
  if f(a):
    ans=len(a)
    break
print(ans)

Solution (Python):
A = input()

for i in range(len(A)):
    A = A[:-1]

    if len(A)%2==1:
        continue

    half_len = int(len(A)/2)
    if A[:half_len] == A[half_len:]:
        break

print(len(A))

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

Solution (Python):
S=input()
n=len(S)
r=0
for i in range(n//2):
  for j in range(1,n//2):
    if i+j*2>=1+n:continue
    if S[i:i+j]==S[i+j:i+2*j]:r=max(r,j)
print(r*2)

Solution (Python):

s = input()
if len(s)%2==1:
    s = s[:len(s)-1]
else:
    s = s[:len(s)-2]
x = int(len(s)/2)

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

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

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

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    S = list(map(str, input().strip()))

    S = S[:-2]
    while len(S) >= 2:
        n = len(S) // 2
        a = ''.join(S[:n])
        b = ''.join(S[n:])

        if a == b:
            return 2 * n
        else:
            S = S[:-2]


if __name__ == '__main__':
    print(main())

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):
hoge=input()

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

Solution (Python):


s = list(input())

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

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

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

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007




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

"""
n = I()
a = LI()
b = [None for i in range(n)]
k = n//2
if n%2:
    for i in range(n):
        if i%2:
            b[k+(i+1)//2] = a[i]
        else:
            b[k-i//2] = a[i]
else:
    for i in range(n):
        if i%2:
            b[k-(i+1)//2] = a[i]
        else:
            b[k+i//2] = a[i]
print(*b)
"""


"""
n = I()
a = LI()
fact = [1 for i in range(n+2)]
for i in range(1,n+2):
    fact[i]*= fact[i-1]*i
    fact[i] %= mod
inv_fact = [1 for i in range(n+2)]
inv_fact[n+1] = pow(fact[n+1],mod-2,mod)
for i in range(1,n+1)[::-1]:
    inv_fact[i] = inv_fact[i+1]*(i+1)
    inv_fact[i] %= mod
count = [None for i in range(n+1)]
for i in range(n+1):
    if count[a[i]] != None:
        l = count[a[i]]
        r = n-i
        break
    count[a[i]] = i
for i in range(1,n+2):
    ans = fact[n+1]*inv_fact[i]*inv_fact[n+1-i]%mod
    if l+r >= i-1:
        ans -= fact[l+r]*inv_fact[i-1]*inv_fact[l+r-i+1]%mod
        ans %= mod
    print(ans)
"""

Solution (Python):
S = input()
for i in range(len(S) - 1, 1, -1):
    if i % 2 != 0:
        continue
    for j in range(len(S[:i]) // 2):
        if S[j] != S[i // 2 + j]:
            break
    else:
        print(i)
        exit()

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

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

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

for i in reversed(range(len(S))):
    S = S[0:i]
    a = S[0 : (len(S) // 2)]
    b = S[(len(S) // 2):]
    if a == b:
        break
print(len(S))

Solution (Python):
def ss(S: str)->int:
    n = len(S)
    ret = 0
    for i in range((n-1)//2):
        if S[i+1:].startswith(S[:i+1]):
            ret = 2*(i+1)

    return ret


if __name__ == "__main__":
    S = input()
    ans = ss(S)
    print(ans)

Solution (Python):
s = input()

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

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

Solution (Python):
s=input()

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

Solution (Python):
s = input()
t=s
b=0
def sakana(sak, u):
  a=0
  for j in range(len(u)//2):
    if u[j] != u[(len(u)//2)+j]:
      break
    else:
      a=a+1
  if a==len(u)//2:
    return 0
  else:
    return 1

for i in range(len(t)):
  s=s[:-1]
  if len(s)%2==0 and sakana(i, s)==0:
    break
  else:
    b=b+1
print(len(t)-b-1)

Solution (Python):

S = input()

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

Solution (Python):
def isGuumozi(s):
    if len(s) % 2 == 1:
        return False
    elif s[:len(s) // 2] == s[len(s) // 2:]:
        return True
    else:
        return False


S = input()

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

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

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

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

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

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

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

Solution (Python):
l=list(input())
l.reverse()
s="".join(l)

for i in range(len(s)):
    s=s.replace(s[0],"",1)
    s1=s[:(len(s)//2)]
    s2=s[(len(s)//2):]
    if s1==s2:
        print(2*len(s1))
        exit()