#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
const int N = 1e6;
bool si[N + 1];
void sieve() {
  primes.push_back(2);
  for (int i = 3; i < N; i += 2) {
    if (!si[i]) {
      primes.push_back(i);
      for (int j = i + i; j < N; j += i) si[j] = 1;
    }
  }
}
bool check(long long n) {
  long long t = sqrtl(n);
  if (t * t == n) return false;
  for (long long r = t; r >= 2; r--) {
    if (n % r) continue;
    long long ts = sqrtl(r);
    if (ts * ts == r) return false;
    ts = sqrtl(n / r);
    if (ts * ts == n / r) return false;
  }
  return true;
}
int main() {
  long long n;
  cin >> n;
  if (check(n)) return cout << n << endl, 0;
  long long t = sqrtl(n);
  long long ans = -1;
  for (long long r = t; r >= 2; r--) {
    if (n % r) continue;
    if (check(n / r)) ans = max(ans, n / r);
    if (check(r)) ans = max(ans, r);
  }
  ans = max(ans, 1LL);
  cout << ans << endl;
  return 0;
}
