import java.util.*;


public class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     *
     * 
     * @param a string字符串 待计算字符串
     * @return int整型
     */
    public int solve (String a) {
        // write code here
        int n = a.length();
        int count = 0;
        for(int i = n / 2;i > 0;i--){
            for(int j = 0;j + i < n;j++){
                if(a.charAt(j) == a.charAt(i + j)){
                    count++;
                }else{
                    count = 0;
                }
                if(count == i) return i * 2;
            }
        }
        return 0;
    }
}