#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
const double eps = (1e-10);
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int dcmp(double x, double y) { return fabs(x - y) <= eps ? 0 : x < y ? -1 : 1; }
double dist(double x1, double y1, double x2, double y2) {
  return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
long long power(long long x, int y) {
  long long temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
vector<long long> divs, asq;
long long n, ans;
bool flag;
void getdivs(long long n) {
  long long sq = ceil(sqrt(n)), i;
  for (i = 1; i < sq; i++)
    if (n % i == 0) divs.push_back(i), divs.push_back(n / i);
  if (i * i == n) divs.push_back(i);
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin >> n;
  for (long long i = 2; i <= (int)1e6; ++i) asq.push_back(i * i);
  getdivs(n);
  sort(((divs).rbegin()), ((divs).rend()));
  for (int i = 0; i < ((int)((divs).size())); ++i) {
    flag = true;
    for (auto& x : asq)
      if (x > divs[i])
        break;
      else if (divs[i] % x == 0) {
        flag = false;
        break;
      }
    if (flag) {
      cout << divs[i];
      break;
    }
  }
  return 0;
}
