#include <bits/stdc++.h>
using namespace std;
int dx8[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0};
int dx[] = {0, 0, 1, -1};
int X[6] = {0, 0, 0, -1, 0, 1};
int Y[6] = {0, 0, -1, 0, 1, 0};
int Z[6] = {1, -1, 0, 0, 0, 0};
long long n;
vector<long long> v;
map<long long, long long> mp;
void gen() {
  for (long long i = 2; i <= 1e6; i++) {
    mp[i * i] = 1;
  }
}
void div(long long n) {
  long long i = 0;
  for (i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (n % (n / i) == 0 && (n / i) != i) v.push_back(n / i);
    }
  }
}
void div2(long long n) {
  long long i = 0;
  for (i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (mp[i]) return;
      if (n % (n / i) == 0 && mp[(n / i)]) return;
    }
  }
  cout << n << "\n";
  exit(0);
}
int main() {
  cin >> n;
  gen();
  div(n);
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < v.size(); i++) {
    div2(v[i]);
  }
}
