import scala.math.sqrt

object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val x = sc.nextInt()  
  val ans = (x to 1 by -1).find(i => sqrt(i) % 1 == 0)
  println(ans.getOrElse(-1)) 
}