#include <bits/stdc++.h>
using namespace std;
bool isLovely(long long n) {
  long long originalN = n;
  int p;
  bool found = false;
  long long d = 2;
  while (n > 1 && d <= sqrt(originalN) && !found) {
    p = 0;
    while (n % d == 0 && p < 3) {
      p++;
      n /= d;
    }
    if (p >= 2) found = true;
    d++;
  }
  return !found;
}
int main() {
  int i;
  long long n;
  cin >> n;
  vector<long long> divs;
  queue<long long> divs2;
  for (i = 1; i <= sqrt(n); i++)
    if (n % i == 0) {
      divs.push_back(i);
      divs2.push(n / i);
    }
  bool found = false;
  long long a;
  while (!divs2.empty() && !found) {
    a = divs2.front();
    divs2.pop();
    if (isLovely(a)) {
      found = true;
      cout << a;
    }
  }
  if (!found) {
    for (i = divs.size() - 1; i >= 0 && !found; i--) {
      a = divs[i];
      if (isLovely(a)) {
        found = true;
        cout << a;
      }
    }
  }
  if (!found) cout << 1;
  return 0;
}
