#include <bits/stdc++.h>
using namespace std;
vector<long long> prime;
bool Isprime[1000020];
void primeSieve() {
  memset(Isprime, true, sizeof(Isprime));
  Isprime[0] = Isprime[1] = false;
  Isprime[2] = true;
  for (long long i = 4; i <= 1000020; i += 2) {
    Isprime[i] = false;
  }
  int sqrtN = sqrt(1000020);
  for (long long i = 3; i <= sqrtN; i += 2) {
    if (Isprime[i] == true) {
      for (int j = i * i; j <= 1000020; j += 2 * i) {
        Isprime[j] = false;
      }
    }
  }
  prime.push_back(2);
  for (long long i = 3; i < 1000020; i += 2) {
    if (Isprime[i] == true) {
      prime.push_back(i);
    }
  }
}
long long factorize(long long n) {
  primeSieve();
  long long sqrtn = sqrt(n);
  long long res = 1;
  for (long long i = 0; i < prime.size() && prime[i] <= sqrtn; i++) {
    if (n % prime[i] == 0) {
      while (n % prime[i] == 0) {
        n /= prime[i];
      }
      res *= prime[i];
      sqrtn = sqrt(n);
    }
  }
  if (n != 1) {
    res *= n;
  }
  return res;
}
int main() {
  long long n;
  cin >> n;
  long long res = 1;
  if (n == 1) {
    cout << 1 << endl;
  } else {
    res = factorize(n);
    cout << res << endl;
  }
  return 0;
}
