function Main(input){
	input=input.split(/\n|\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	
	var arr=[1000, 961, 900, 841, 784, 729, 729, 729, 676, 625, 625, 576, 529, 512, 512, 484, 441, 400, 361, 343, 324, 289, 256, 256, 256, 243, 225, 216, 196, 169, 144, 128, 125, 121, 100, 81, 81, 64, 64, 64, 49, 36, 32, 27, 25, 16, 16, 9, 8, 4, 1];
	var a=1;
	for(var i=0;i<arr.length;i=(i+1)|0){
		if(input[0]>=arr[i]){a=arr[i];break;}
	}
	console.log(a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));