#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
void divis(long long int n) {
  long long int i;
  for (i = 1; i * i < n; i++)
    if (n % i == 0) v.push_back(i), v.push_back(n / i);
  if (i * i == n) v.push_back(i);
}
int main() {
  long long int flag = 0, n;
  cin >> n;
  divis(n);
  sort(v.begin(), v.end());
  while (1) {
    for (int i = 1; i < v.size(); i++) {
      long long int m = sqrt(v[i]);
      if (m * m == v[i] && v[v.size() - 1] % v[i] == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << v[v.size() - 1] << endl;
      break;
    } else {
      v.pop_back();
      for (int i = v.size() - 1; i >= 0; i++) {
        if (v[i] > n && i == v.size() - 1) {
          v.pop_back();
        } else
          break;
      }
      n = v[v.size() - 1];
      for (int i = 0; i < v.size(); i++) {
        if (n % v[i] != 0) v[i] == n + 100;
      }
      flag = 0;
    }
  }
  return 0;
}
