#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 2; 1ll * i * i <= n; ++i) {
    if (n % i) {
      continue;
    }
    int cnt = 0;
    while (n % i == 0) {
      n /= i;
      ++cnt;
    }
    if (n != 1) {
      cout << 1;
    } else {
      cout << i;
    }
    return 0;
  }
  cout << n;
  return 0;
}
