#include <bits/stdc++.h>
using namespace std;
bool isPerfectSquare(long double x) {
  if (x == 1) return 0;
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
int is_prime(long long int n) {
  if (n == 1) return 0;
  if (n == 2) return 1;
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  long long int n, i;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << n;
    return 0;
  }
  for (i = 2; i * i <= n; i++) {
    if (n % (i * i) == 0) {
      n = n / i;
      i = 1;
    }
  }
  cout << n;
}
