#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, x;
  cin >> n, x = n;
  long long cnt = 0, d = n;
  for (int i = 2; 1LL * i * i <= x; i++) {
    if (x % i == 0) {
      cnt++, d = i;
      while (x % i == 0) x /= i;
    }
    if (cnt > 2) break;
  }
  if (x > 1) cnt++;
  if (cnt <= 1)
    cout << d;
  else
    cout << 1;
  return 0;
}
