#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> vv;
  long long arr[1000009] = {0};
  for (long long i = 2; i <= 1000009; i++) {
    if (arr[i] == 0) {
      vv.push_back(i);
      for (long long j = i + i; j < 1000009; j += i) {
        arr[j] = 1;
      }
    }
  }
  long long x = 0, c = 0, first = n;
  for (long long i = 0; i < vv.size(); i++) {
    if (n % vv[i] == 0) {
      c = vv[i];
      x++;
    }
    while (n % vv[i] == 0) {
      n = n / vv[i];
    }
  }
  if (x == 1 and c == first) {
    cout << first;
  } else if (x == 1 and c != first and n == 1) {
    cout << c;
  } else if (x == 0) {
    cout << first;
  } else {
    cout << 1;
  }
}
