#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << n << endl;
    return 0;
  }
  vector<long long> sqdiv;
  sqdiv.clear();
  int sq = sqrt(n);
  long long m = 0;
  long long p = 0;
  for (int i = 1; i <= sq; i++) {
    if (n % i == 0) {
      m = i;
      p = sqrt(m);
      if (p * p == m) {
        if (m != 1) sqdiv.push_back(m);
      }
      m = n / i;
      p = sqrt(m);
      if (p * p == m) {
        sqdiv.push_back(m);
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= sq; i++) {
    if (n % i == 0) {
      m = i;
      int f = 1;
      {
        for (int j = 0; j < (int)(sqdiv.size()); j++) {
          if (m % sqdiv[j] == 0) {
            f = 0;
            break;
          }
        }
      }
      if (f) ans = max(ans, m);
      m = n / i;
      f = 1;
      {
        for (int j = 0; j < (int)(sqdiv.size()); j++) {
          if (m % sqdiv[j] == 0) {
            f = 0;
            break;
          }
        }
      }
      if (f) ans = max(ans, m);
    }
  }
  cout << ans << endl;
  return 0;
}
