#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int up = int(1e6) + 5;
  vector<bool> prime(up, 1);
  prime[0] = 0;
  prime[1] = 0;
  for (int(i) = (int)(2); (i) < (int)(up); ++(i)) {
    if (prime[i]) {
      for (long long j = (long long)i * i; j < up; j += i) {
        prime[j] = 0;
      }
    }
  }
  vector<int> pr;
  for (int(i) = (int)(0); (i) < (int)(up); ++(i)) {
    if (prime[i]) pr.push_back(i);
  }
  long long n;
  cin >> n;
  if (n == 1) {
    cout << n;
    return 0;
  }
  map<long long, int> fac;
  int i = 0;
  while (n > 1) {
    if (i < pr.size()) {
      while (n % pr[i] == 0) {
        fac[pr[i]]++;
        n /= pr[i];
      }
      i++;
    } else {
      fac[n]++;
      n /= n;
    }
  }
  auto it = fac.end();
  it--;
  long long ans = 1;
  while (it != fac.begin()) {
    ans *= it->first;
    it--;
  }
  ans *= it->first;
  cout << ans;
}
