#include <bits/stdc++.h>
using namespace std;
long long n;
int a[1000001];
int b[1000001];
int gg(int n) {
  int p = 0;
  for (int i = 0; i < n + 1; i++) b[i] = 1;
  b[0] = 0;
  b[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (b[i]) {
      a[p++] = i;
      for (int j = 2 * i; j <= n; j += i) b[j] = 0;
    }
  }
  return p;
}
bool isPrime_3(long long num) {
  if (num == 2 || num == 3) return 1;
  if (num % 6 != 1 && num % 6 != 5) return 0;
  long long tmp = sqrt(num);
  for (long long i = 5; i <= tmp; i += 6)
    if (num % i == 0 || num % (i + 2) == 0) return 0;
  return 1;
}
int main() {
  cin >> n;
  int www = sqrt(n);
  int num = gg(www);
  long long temp;
  if (isPrime_3(n)) {
    cout << n;
    return 0;
  }
  for (long long i = 0; i < num; i++)
    if (n % a[i] == 0) {
      temp = (long long)a[i];
      break;
    }
  while (n > 1) {
    if (n % temp == 0)
      n /= temp;
    else
      break;
  }
  if (n == 1)
    cout << temp << endl;
  else
    cout << "1";
}
