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