#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    ll n;
    cin >> n;
    vector<ll> sq;
    ll cnt = 1;
    while (cnt * cnt <= n)
    {
        sq.push_back(cnt*cnt);
        cnt++;
    }
    sort(sq.begin(), sq.end());
    cout << sq[sq.size() - 1] << endl;
    return 0;
}
#include<iostream>
using namespace std;
int main(){
  int a;cin>>a;
  if(a<112)cout<<111<<endl;
  else if(a<223)cout<<222<<endl;
  else if(a<334)cout<<333<<endl;
  else if(a<445)cout<<444<<endl;
  else if(a<556)cout<<555<<endl;
  else if(a<667)cout<<666<<endl;
  else if(a<778)cout<<777<<endl;
  else if(a<889)cout<<888<<endl;
  else cout<<999<<endl;
}
