#include <bits/stdc++.h>
using namespace std;
inline long long MAX(long long a, long long b) { return (a > b) ? (a) : (b); }
inline long long MIN(long long a, long long b) { return (a < b) ? (a) : (b); }
const int MOD = 998244353;
int inv(int a) {
  int r = 1, t = a, k = MOD - 2;
  while (k) {
    if (k & 1) r = (long long)r * t % MOD;
    t = (long long)t * t % MOD;
    k >>= 1;
  }
  return r;
}
long long pow(long long n) {
  long long prod = 1, m = 2;
  while (n > 0) {
    if (n % 2 == 1) prod = (prod * m) % MOD;
    n /= 2;
    m *= m;
    m %= MOD;
  }
  return prod;
}
int main() {
  long long const sz = 2e3 + 10;
  long long i, j, val, q[sz], r, k, g, p[sz], b, block[sz], n, t, cnt, m,
      mina = 1e18, sum = 0, minj, data[sz + 1][3], x, y, l;
  ofstream f;
  string s, s2;
  f.open("test.txt");
  cin >> n;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
      }
      if (n > 1) {
        cout << "1";
        exit(0);
      }
      cout << i;
      exit(0);
    }
  }
  cout << n;
  return 0;
}
