#include <bits/stdc++.h>
using namespace std;

#define Name "sokidieu"

#define FOR(i,l,r) for (int i = l; i <= r; i++)
#define FOD(i,r,l) for (int i = r; i >= l; i--)
#define ll long long
#define ld long double

#define upsqrt(n) (sqrt(n)==(ll)sqrt(n)?(ll)sqrt(n):(ll)sqrt(n)+1)

bool isPrime(ll n){
    for(int i = 2; i*i<=n; i++)if(n%i==0)return 0;
    return n > 1;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	if (fopen(Name".inp", "r")) {
		freopen(Name".inp", "r", stdin);
		freopen(Name".out", "w", stdout);
	}

    ll n;
    cin>>n;

    for(ll x = upsqrt(n); 1; x++){
        if(isPrime(x)){
            cout<<x*x;
            break;
        }
    }
}
