n = gets.chomp.to_i m = (n ** 0.5).to_i flg = false for x in m - 1..m + 1 if x ** 2 == n echo x flg = true break end end puts m if not flg