#include <bits/stdc++.h>
using namespace std::chrono;
using namespace std;
inline int getint() {
  char c = getchar();
  int x = 0, minus = 1;
  while (c != EOF && c != '-' && !isdigit(c)) c = getchar();
  if (c == '-') {
    minus = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * minus;
}
inline long long getll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline double getdb() {
  static double x;
  scanf("%lf", &x);
  return x;
}
template <typename T>
void updmax(T& a, T const& b) {
  a = max(a, b);
}
template <typename T>
void updmin(T& a, T const& b) {
  a = min(a, b);
}
template <typename T>
int Descr(T* from, T* to) {
  sort(from, to);
  return (int)(unique(from, to) - from);
}
template <typename T>
int LBound(T* from, T* to, T const& val) {
  return (int)(lower_bound(from, to, val) - from);
}
template <typename T>
int UBound(T* from, T* to, T const& val) {
  return (int)(upper_bound(from, to, val) - from);
}
time_point<system_clock> timing;
void TimingBegin() { timing = system_clock::now(); }
double TimingEnd(const char* c = "time:") {
  auto end = system_clock::now();
  auto d = duration_cast<microseconds>(end - timing);
  auto dt =
      double(d.count()) * microseconds::period::num / microseconds::period::den;
  printf("%s %.10f", c, dt);
  return dt;
}
void TimingTick(const char* c = "time:") {
  TimingEnd(c);
  TimingBegin();
}
template <typename T>
vector<int> arr(int size) {
  return move(vector<int>(size));
}
template <typename T>
struct opt {
  T value;
  bool valid;
};
long long s[1005000];
int t = 0;
int main() {
  long long n = getll();
  long long lim = (int)ceil(sqrt(n));
  for (int i = 2, lim__lim = (lim); i <= lim__lim; i++) s[t++] = 1LL * i * i;
  long long res = 0;
  for (int i = 1, lim__lim = (lim); i <= lim__lim; i++) {
    if (n % i != 0) continue;
    bool able = true;
    for (int j = 0, lim__lim = (t - 1); j <= lim__lim; j++)
      if (i % s[j] == 0) {
        able = false;
        break;
      }
    if (able) updmax(res, 1LL * i);
    able = true;
    for (int j = 0, lim__lim = (t - 1); j <= lim__lim; j++)
      if (n / i % s[j] == 0) {
        able = false;
        break;
      }
    if (able) updmax(res, n / i);
  }
  printf("%lld\n", res);
  return 0;
}
