#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e6 + 5;
bool boo[Maxn];
int p[Maxn];
int k = 0;
void prim() {
  memset(boo, 0, sizeof(boo));
  boo[0] = boo[1] = 1;
  for (int i = 2; i < Maxn; i++) {
    if (!boo[i]) p[k++] = i;
    for (int j = 0; j < k && i * p[j] < Maxn; j++) {
      boo[i * p[j]] = 1;
      if (!(i % p[j])) break;
    }
  }
}
long long phi(long long n) {
  long long flag;
  long long sum = 0, cnt = 0;
  long long ans = n;
  for (long long i = 0; p[i] * p[i] <= n && i < k; i++) {
    if (n % p[i] == 0) {
      flag = p[i];
      sum++;
      do {
        cnt++;
        n /= p[i];
      } while (n % p[i] == 0);
    }
  }
  if (sum == 1 && n == 1 && cnt > 1)
    return flag;
  else if ((sum == 1 && n == 1) || sum == 0)
    return ans;
  else
    return 1;
}
int main() {
  prim();
  long long n;
  scanf("%lld", &n);
  printf("%lld\n", phi(n));
  return 0;
}
