#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
template <typename T>
T abs(T &n) {
  return (n < 0 ? -n : n);
}
template <typename T>
T max(T &a, T &b) {
  return (!(a < b) ? a : b);
}
template <typename T>
T min(T &a, T &b) {
  return (a < b ? a : b);
}
template <typename T>
T mod(T a, T b) {
  return (a < b ? a : a % b);
}
long long mulmod(long long a, long long b, long long m) {
  long long q = (long long)(((long double)a * (long double)b) / (long double)m);
  long long r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mod(x * p, m);
    p = mod(p * p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
T gcd(T a, T b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
long long primes[1000000];
long long sieve[1000000];
void build() {
  sieve[1] = 1;
  sieve[2] = 0;
  for (int i = 2; i * i <= 1000000; i++) {
    if (sieve[i] == 0) {
      for (int j = i * i; j <= 1000000; j += i) {
        sieve[j] = 1;
      }
    }
  }
}
bool check(long long n) {
  for (int i = 1; i <= 78498; i++) {
    if (n % (primes[i] * primes[i]) == 0) return 0;
  }
  return 1;
}
int main(int argc, char *argv[]) {
  io();
  long long n;
  cin >> n;
  build();
  int j = 0;
  for (int i = 2; i <= 1000000; i++) {
    if (sieve[i] == 0) {
      primes[++j] = i;
    }
  }
  long long ans = -1;
  if (check(n)) {
    cout << n << '\n';
    return 0;
  }
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      long long d1 = i;
      long long d2 = n / i;
      if (check(d2)) {
        ans = d2;
        break;
      } else if (check(d1)) {
        ans = d1;
      }
    }
  }
  if (ans == -1) {
    cout << 1 << '\n';
    return 0;
  }
  cout << ans << '\n';
  return 0;
}
