unittest
{
	assert( [ "10" ].parse.expand.solve == 9 );
	assert( [ "81" ].parse.expand.solve == 81 );
	assert( [ "271828182" ].parse.expand.solve == 271821169 );
}



import std.conv;
import std.math;
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 n = input.front.strip.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	foreach_reverse( i; 2 .. n + 1 )
	{
		auto s = sqrt( cast( real ) i );
		if( s % 1 == 0 ) return i;
	}
	
	return 1;
}
