import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    string s;
    scan(s);
    // writeln(s);
    foreach (i; 2 .. s.length)
    {
        // writeln(s[0 .. $ - i]);
        auto ss = s[0 .. $ - i];
        if (func(ss))
        {
            writeln(ss.length);
            return;
        }
    }
    // writeln(s[0 .. (s.length / 2)]);
    // writeln(s[(s.length / 2) .. s.length]);
}

auto func(string s)
{
    if (s[0 .. (s.length / 2)] == s[(s.length / 2) .. s.length])
    {
        return true;
    }
    else
    {
        return false;
    }
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
