#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF (1LL<<25) //33554432 #define PI 3.14159265359 #define EPS 1e-12 //#define int ll ll issquare(ll n) { // ll tmp = sqrt(n); // cout << n << " " << tmp << " " << tmp*tmp << endl; // return tmp*tmp == n; for(ll i = sqrt(n)-1; i*i<=n; ++i) { if(n%i == 0) return true; } return false; } signed main(void) { ll x; cin >> x; VL v; for(ll i=1; i*i<=x; ++i) { if(x%i == 0) { v.push_back(i); if(i*i != x) v.push_back(x/i); } } sort(ALL(v)); for(ll i: v) { //cout << "i:" << i << endl; if(issquare(x*i)) { cout << i << endl; break; } } return 0; }