#include <bits/stdc++.h>
using namespace std;
bool is_prime(long long n) {
  long long i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  long long n, i;
  cin >> n;
  set<int> s;
  if (is_prime(n))
    cout << n << endl;
  else {
    while (n % 2 == 0) {
      n = n / 2;
      s.insert(2);
    }
    while (n % 3 == 0) {
      n = n / 3;
      s.insert(3);
    }
    for (i = 5; i * i <= n; i++) {
      if (s.size() >= 2) break;
      while (n % i == 0) {
        n = n / i;
        s.insert(i);
      }
    }
    if (s.size() == 1) {
      int k = *s.begin();
      if (n != 1)
        cout << 1 << endl;
      else
        cout << k << endl;
    } else
      cout << 1 << endl;
  }
}
