#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
const long long inf = 1e18;
long long prime[N], st[N], cnt, p[N];
void get_prime() {
  for (int i = 2; i < N; i++) {
    if (st[i] == 0) {
      prime[cnt++] = i;
      p[i] = 1;
    }
    for (int j = 0; j < cnt && i * prime[j] < N; j++) {
      st[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        break;
      }
    }
  }
}
bool check(long long t) {
  for (long long i = 2; i * i <= t; i++) {
    if (t % i == 0) return false;
  }
  return true;
}
int main() {
  get_prime();
  long long n;
  while (cin >> n) {
    int ans = 0, flag;
    for (int i = 0; i < cnt; i++) {
      if (prime[i] >= n) break;
      if (n % prime[i] == 0) {
        ans++;
        if (ans > 2) break;
        flag = prime[i];
        long long t = n / flag;
        if (t == flag) continue;
        if (check(t)) {
          ans++;
        }
      }
    }
    if (ans == 0)
      cout << n << endl;
    else if (ans == 1)
      cout << flag << endl;
    else
      cout << 1 << endl;
  }
  return 0;
}
