#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> prime_disvor;
  for (long long p = 2; p * p <= n; p++) {
    if (n % p == 0) {
      prime_disvor.push_back(p);
    }
    while (n % p == 0) {
      n /= p;
    }
  }
  if (n > 1) {
    prime_disvor.push_back(n);
  }
  if (prime_disvor.size() == 1) {
    cout << prime_disvor.front() << endl;
  } else if (prime_disvor.size() > 1) {
    cout << 1 << endl;
  } else {
    cout << n << endl;
  }
  return 0;
}
