#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
  long long n;
  scanf("%I64d", &n);
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (i * i == n)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(n / i);
      }
    }
  }
  sort(v.begin(), v.end());
  for (int i = v.size() - 1; i >= 0; i--) {
    long long x = v[i];
    int cn = 1;
    for (int j = 1; j <= i; j++) {
      if (x % v[j] == 0) {
        if ((x / v[j]) % v[j] == 0) {
          cn = 0;
          break;
        }
      }
    }
    if (cn) {
      printf("%I64d\n", x);
      return 0;
    }
  }
  return 0;
}
