object Main extends App {
  val n = io.StdIn.readInt()

  def searchRec(i: Int): Int = {
    if (i == 0) 0
    else {
      val sqrt = math.sqrt(i)
      if (sqrt - sqrt.toInt == 0) i else searchRec(i - 1)
    }
  }
  
  searchRec(n)
}