#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl

int main(){
  int X;
  cin >> X;
  rep(i,X){
  rep(j,X){
    if(j*j == X-i) {
      cout << X - i << endl;
      return 0;
    }
  }
 }
}
