#include <bits/stdc++.h>
using namespace std;
set<long long> pr;
void SieveOfEratosthenes(long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) pr.insert(p);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, c = 0, pa = 0;
  cin >> n;
  long long ans = n;
  SieveOfEratosthenes(1000000);
  for (auto it = pr.begin(); it != pr.end(); it++) {
    if (n % *it == 0) {
      while (n % *it == 0) {
        n /= (*it);
      }
      c++;
      pa = *it;
    }
  }
  if (isPrime(n)) {
    c++;
    if (c == 1) {
      cout << n;
    } else {
      cout << 1;
    }
  } else if (c == 1) {
    cout << pa;
  } else {
    cout << 1;
  }
  return 0;
}
