#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> v;
  long long int n;
  cin >> n;
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      v.push_back(n / i);
    }
  }
  set<long long int> s;
  for (int i = 0; i < v.size(); i++) {
    s.insert(v[i]);
  }
  v.clear();
  int w = s.size();
  long long int y = 0;
  for (int i = 0; i < w; i++) {
    y = *s.begin();
    v.push_back(y);
    s.erase(y);
  }
  for (long long int i = v.size() - 1; i >= 0; i--) {
    int e = 0;
    for (long long int j = 2; j * j <= v[i]; j++) {
      if (v[i] % (j * j) == 0) {
        e = 1;
        break;
      }
    }
    if (e == 0) {
      cout << v[i];
      return 0;
    }
  }
  cout << -1;
  return 0;
}
