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