function Main(input) {

	for(var i = 0; i<input;i++){
		if((Math.sqrt(input - i) + '').indexOf('.') < 0){
			console.log(input - i);
			return;
		}
	}
	console.log(1);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));