#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool cmps(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.second < p2.second;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
vector<long long> d1;
void div(long long n) {
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        d1.push_back(n / i);
      else {
        d1.push_back(i);
        d1.push_back(n / i);
      }
    }
  }
}
bool isPerfectSquare(long long x) {
  if (x == 1) return false;
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool aval(long long n) {
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        if (isPerfectSquare(i)) return false;
      } else {
        if (isPerfectSquare(i) || (isPerfectSquare(n / i))) return false;
      }
    }
  }
  return true;
}
int32_t main() {
  long long n;
  cin >> n;
  div(n);
  sort(d1.begin(), d1.end());
  {
    cerr << " ["
         << "d1"
         << ": ";
    for (auto it : d1) cerr << it << " ";
    cerr << "]\n";
  }
  for (long long i = d1.size() - 1; i >= 0; i--) {
    if (aval(d1[i])) {
      cout << d1[i] << endl;
      break;
    }
  }
  return 0;
}
