unittest
{
	assert( [ "abaababaab" ].parse.expand.solve == 6 );
	assert( [ "xxxx" ].parse.expand.solve == 2 );
	assert( [ "abcabcabcabc" ].parse.expand.solve == 6 );
	assert( [ "akasakaakasakasakaakas" ].parse.expand.solve == 14 );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.strip;
	return tuple( s );
}

auto solve( string s )
{
	for( auto i = ( s.length - 1 ) - ( s.length - 1 ) % 2; 2 <= i; i -= 2 )
	{
		auto t = s[ 0 .. i ];
		if( t[ 0 .. $ / 2 ] == t[ $ / 2 .. $ ] ) return t.length;
	}
	
	assert( false );
}
