#include <bits/stdc++.h>
using namespace std;
long long n;
long long ans = 0;
long long d = 2;
map<int, int> pfac;
map<int, int>::iterator it;
bool prime = true;
int gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void solve() {
  long long p = 1e9;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      prime = false;
      if (gcd(n / i, i) == 1) ans = 1;
      p = min(p, i);
    }
  }
  int cnt = 1;
  long long sum = p;
  while (sum < n && !prime) {
    sum *= p;
    cnt += 1;
  }
  if (sum == n && ans != 1) ans = p;
}
int main() {
  scanf("%lld", &n);
  solve();
  if (prime) ans = n;
  printf("%lld\n", ans);
  return 0;
}
