#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, count, t, x, y, i;
  count = 0;
  map<long long int, long long int> m;
  cin >> n;
  y = n;
  while (n % 2 == 0) {
    m[2] = 1;
    x = 2;
    n = n / 2;
  }
  for (i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      m[i] = 1;
      x = i;
      n = n / i;
    }
  }
  if (n > 2) m[n] = 1;
  if (y == n)
    printf("%lld\n", y);
  else if (m.size() == 1)
    printf("%lld\n", x);
  else
    printf("1\n");
  return 0;
}
