#include <bits/stdc++.h>
using namespace std;
map<long long, long long> prime_factorization(long long n) {
  map<long long, long long> res;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n = n / i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
vector<long long> divisors(long long n) {
  vector<long long> res;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      res.push_back(i);
      if (i * i != n) res.push_back(n / i);
    }
  }
  sort(res.begin(), res.end());
  return res;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> arr = divisors(n);
  long long sz = arr.size();
  long long ans = 0;
  for (int i = sz - 1; i >= 0; i--) {
    map<long long, long long> mp = prime_factorization(arr[i]);
    bool f = true;
    for (auto p : mp) {
      if (p.second >= 2) f = false;
    }
    if (f) {
      ans = arr[i];
      break;
    }
  }
  cout << ans;
  return 0;
}
