#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int len = s.size();
    
    if (len == 0) {
        cout << 0;
        return 0;
    }
    
    while (len % 2 == 0) {
        int half = len / 2;
        string left = s.substr(0, half);      
        string right = s.substr(half, half);  
        
        if (left != right) break;
        
        s = left; 
        len = half;  
    }
    
    cout << len;
    return 0;
}
/**************************************************************
	Problem: 1134
	User: zhouhongyi
	Language: C++
	Result: Wrong Answer
****************************************************************/