#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long N = 200005;
long long n;
void solve() {
  long long i, j, k;
  cin >> n;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      if (n == 1)
        cout << i << "\n";
      else
        cout << 1 << "\n";
      return;
    }
  }
  cout << n << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1, i, j, k;
  while (t--) {
    solve();
  }
  return 0;
}
