#include <bits/stdc++.h>
using namespace std;
void inline speedup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
long long expo(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b % 2 == 1) res = (res * a) % m;
    a = (a * a) % m;
    b /= 2;
  }
  return res;
}
long long m = 1000000007;
bool comp(long long a, long long b) {
  if (a > b) return true;
  return false;
}
int main() {
  speedup();
  long long i, j;
  map<long long, long long> p;
  for (i = 2; i <= 1000000; i++) p[i * i] = 1;
  vector<long long> v;
  long long n, ans = 0;
  cin >> n;
  for (i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i * i != n) {
        v.push_back(n / i);
      }
    }
  }
  for (i = 0; i < v.size(); i++) {
    long long flag = 0;
    for (j = 1; j * j <= v[i]; j++) {
      if (v[i] % j == 0) {
        if (p[j] == 1 || p[v[i] / j] == 1) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0) ans = max(ans, v[i]);
  }
  cout << ans << endl;
}
