#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
int setBit(int n, int x) { return n | (1 << x); }
int clearBit(int n, int x) { return n & ~(1 << x); }
int toggleBit(int n, int x) { return n ^ (1 << x); }
bool checkBit(int n, int x) { return (bool)(n & (1 << x)); }
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dx4[] = {1, 0, -1, 0};
int dy4[] = {0, 1, 0, -1};
const long long inf = 1000000000000000000;
template <typename T>
void amax(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void amin(T& t1, T t2) {
  t1 = min(t1, t2);
}
long long __gcd(long long a, long long b) {
  if (a + b == 0) return a + b;
  if (a % b == 0) return b;
  return __gcd(b, a % b);
}
long long fact(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) {
    res = res * i;
  }
  return res;
}
long long nCr(long long n, long long r) {
  return fact(n) / (fact(r) * fact(n - r));
}
long long nPr(int n, int r) { return fact(n) / fact(n - r); }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (1LL * res * a);
    a = (1LL * a * a);
    b >>= 1;
  }
  return res;
}
void yes() {
  cout << "YES" << endl;
  return;
}
void no() {
  cout << "NO" << endl;
  return;
}
bool isPrime(long long n) {
  if (n == 1) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
void prt(vector<int> arr) {
  for (int i = 0; i < arr.size(); i++) cout << arr[i] << " ";
  cout << endl;
}
void prt(int* arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << endl;
}
void solve() {
  long long n;
  cin >> n;
  long long ans = n;
  int x = sqrt(n);
  for (int i = 2; i <= x; i++) {
    if (n % i == 0) {
      long long a = i;
      long long b = n / i;
      if (a % b == 0 || b % a == 0)
        amin(ans, min(a, b));
      else
        ans = 1;
    }
  }
  cout << ans << endl;
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
