#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, i, j, ans = 0, cnt = 0;
  cin >> n;
  vector<long long int> a;
  ans = n;
  if (n % 2 == 0) a.push_back(2);
  while (n % 2 == 0 && n > 0) n /= 2;
  for (i = 3; i * i <= n; i += 2) {
    if (n % i == 0) {
      a.push_back(i);
      while (n % i == 0) n /= i;
    }
  }
  if (n > 1) a.push_back(n);
  if (a.size() > 1)
    ans = 1;
  else if (a.size() == 1)
    ans = a[0];
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
