#include <bits/stdc++.h>
using namespace std;
long long vis[10000006];
vector<long long> pr;
void sieve() {
  for (long long i = 2; i <= 10000001; i++) {
    if (vis[i] == 0) {
      pr.push_back(i);
      for (long long j = i + i; j <= 10000001; j += i) vis[j] = 1;
    }
  }
}
int main() {
  sieve();
  long long n;
  cin >> n;
  long long sq = sqrt(n);
  long long m = n;
  long long prev = -1, f = 0;
  for (long long i = 0; i < (long long)(pr.size()) && pr[i] <= sq; i++) {
    while ((n % pr[i]) == 0LL) {
      n /= pr[i];
      if (pr[i] != prev && prev != -1) {
        f = 1;
        break;
      }
      prev = pr[i];
    }
  }
  if (n != m) {
    if (n != 1 || f)
      m = 1;
    else
      m = prev;
  }
  cout << m << endl;
  return 0;
}
