#include <bits/stdc++.h>
const int N = 1000010;
const int inf = ~0U >> 1;
using namespace std;
queue<long long> Q1;
stack<long long> Q2;
int main() {
  long long n;
  cin >> n;
  Q1.push(n);
  for (long long i = 2; i * i <= n; i++) {
    if (n % i) continue;
    Q1.push(n / i);
    Q2.push(i);
  }
  int flag = 0;
  long long rec = 0;
  while (!Q1.empty()) {
    long long u = Q1.front();
    flag = 0;
    for (long long j = 2; j * j <= u; j++)
      if (u % (j * j) == 0) {
        flag = 1;
        break;
      }
    if (!flag) {
      rec = u;
      break;
    }
    Q1.pop();
  }
  if (rec == 0)
    while (!Q2.empty()) {
      long long u = Q2.top();
      flag = 0;
      for (long long j = 2; j * j <= u; j++)
        if (u % (j * j) == 0) {
          flag = 1;
          break;
        }
      if (!flag) {
        rec = u;
        break;
      }
      Q2.pop();
    }
  printf("%I64d\n", rec);
}
