#include <bits/stdc++.h>
using namespace std;
long long n;
void solve() {
  int cnt = 0, ans = 0;
  if (n == 1) {
    cout << n;
    return;
    ;
  }
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      ans = i;
      while (n % i == 0) {
        n /= i;
      }
      cnt++;
    }
    if (cnt > 1) {
      cout << 1;
      return;
    }
  }
  if (cnt == 1 && n != 1) {
    cout << 1;
    return;
  }
  if (n != 1)
    cout << n;
  else
    cout << ans;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) {
    cin >> n;
    solve();
  }
}
