#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  int flag = 0, p = -1;
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      if (n == 1)
        flag = 1;
      else
        flag = 2;
      p = i;
      break;
    }
  }
  if (flag == 0)
    cout << n << endl;
  else if (flag == 1)
    cout << p << endl;
  else
    cout << 1 << endl;
  return 0;
}
