#include <bits/stdc++.h>
using namespace std;
const long double pi = 2 * acos(0.0);
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class TT>
bool pal(T a, TT n) {
  int k = 0;
  for (int i = 0; i <= n / 2; i++) {
    if (a[i] != a[n - i - 1]) {
      k = 1;
      break;
    }
  }
  return k ? 0 : 1;
}
bool ko(long long x) {
  if (x == 1) return 0;
  long long m = sqrt(x);
  return (m * m == x);
}
bool ok(long long x) {
  for (long long i = 1; i * i <= x; i++) {
    if ((x % i != 0)) continue;
    long long q = x / i;
    if (ko(q) || ko(i)) return 0;
  }
  return 1;
}
int main() {
  long long n, ans = 1;
  cin >> n;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i != 0) continue;
    long long j = n / i;
    if (ok(i)) umax(ans, i);
    if (ok(j)) umax(ans, j);
  }
  cout << ans;
  getchar();
  getchar();
  return 0;
}
