#include <bits/stdc++.h>
using namespace std;
void prime_sieve(long long int n, long long int a[]) {
  for (long long int i = 2; i * i <= n; i++) {
    if (a[i] == 1) {
      for (long long int j = i * i; j <= n; j += i) a[j] = 0;
    }
  }
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n";
    exit(0);
  }
  long long int a[1000010];
  for (long long int i = 0; i <= 1000001; i++) a[i] = 1;
  prime_sieve(1000001, a);
  vector<long long int> v;
  long long int copy = n;
  for (long long int i = 2; i <= 1000001; i++) {
    if (a[i] == 1 && n % i == 0) {
      v.push_back(i);
      while (copy % i == 0) copy /= i;
    }
  }
  if (copy > 1) v.push_back(copy);
  if (v.size() == 1)
    cout << v[0] << "\n";
  else
    cout << "1\n";
}
