#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  if (n == 1) return cout << 1 << endl, 0;
  bool flag = true;
  long long theta;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      flag = false;
      theta = i;
      break;
    }
  }
  if (flag) return cout << n << endl, 0;
  long long x = 0;
  while (n % theta == 0) {
    n = n / theta;
  }
  if (n == 1)
    cout << theta << endl;
  else
    cout << 1 << endl;
}
