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