#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, i, j, k, f;
  cin >> n;
  vector<long long> factors;
  set<long long> sq;
  for (i = 2; (long long)(i * i) <= n; i++) {
    sq.insert((long long)(i * i));
  }
  for (i = 1; (long long)(i * i) <= n; i++) {
    if (n % i == 0) {
      factors.push_back(i);
      if (n / i != i) factors.push_back(n / i);
    }
  }
  sort(factors.begin(), factors.end());
  for (i = factors.size() - 1; i >= 0; i--) {
    f = 0;
    for (auto it = sq.begin(); it != sq.end(); it++) {
      if (factors[i] % (*it) == 0) {
        factors[i] = -1;
        f = 1;
        break;
      }
    }
    if (!f) {
      cout << factors[i];
      return 0;
    }
  }
  return 0;
}
