#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long int n, ans;
  cin >> n;
  long long int g = n;
  for (int i = 2; i < 1000000 && i < n; ++i) {
    if (n % i == 0) {
      ans = n;
      while (ans % i == 0) {
        ans = ans / i;
      }
      if (ans == 1) {
        g = i;
      } else {
        g = 1;
      }
      break;
    }
  }
  cout << g << endl;
}
