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

int main() {
    ll x;
    cin>>x;
    ll y=1;
    for (ll i=2;i*i<=x;i++) {
        int cnt=0;
        while (x%i==0) {
            x/=i;
            cnt++;
        }
        if (cnt%2!=0) y*=i;
    }
    if (x>1) y*=x;
    else cout<<y<<endl;
    return 0;
}