#include <bits/stdc++.h>
using namespace std;
int main() {
  int c, c2;
  long long n;
  long long orig;
  scanf("%lld", &n);
  orig = n;
  vector<long long> primes;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) primes.push_back(i);
    while (n % i == 0) n /= i;
  }
  if (n > 1 && n != orig) primes.push_back(n);
  if (primes.empty())
    printf("%lld\n", orig);
  else if (primes.size() == 1)
    printf("%lld\n", primes.front());
  else
    printf("1\n");
  return 0;
}
