#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long maxn = 1e5 + 1;
void swap(long long *xp, long long *yp) {
  long long temp = *xp;
  *xp = *yp;
  *yp = temp;
}
void print(vector<long long> v) {
  long long i, j, n = v.size();
  for (i = 0; i < n; i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
void scan(vector<long long> &v, long long n) {
  for (long long i = 0; i < n; i++) cin >> v[i];
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
bool isprime(long long n) {
  if (n == 1) return false;
  long long i, j, k;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
long long getFactorization(long long n) {
  long long i, j = n, k, sum = 0;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      if (isprime(i)) {
        sum++;
        j = i;
      }
      if (n / i != i && isprime(n / i)) {
        sum++;
      }
    }
    if (sum >= 2) return -1;
  }
  return j;
}
int main() {
  long long int i, j, inc, dec, t, r;
  long long int c, d, e, temp, m, p, w, k, x, y, sum, pre, temp2, mid, n, low,
      high, ans;
  t = 1;
  n = 1;
  while (t--) {
    cin >> n;
    if (n == 1) {
      ans = n;
      cout << ans << "\n";
      ;
      continue;
    }
    ans = getFactorization(n);
    if (ans == -1) {
      ans = 1;
      cout << ans << "\n";
      ;
    } else {
      cout << ans << "\n";
      ;
    }
  }
  return 0;
}
