#include <bits/stdc++.h>
using namespace std;
struct T {
  T *l, *r;
  long long d, sum, mx;
  bool pushed;
  void recalc(long long len, long long d) {
    this->d = d;
    sum = len * d;
    mx = max(0ll, sum);
  }
  T(long long len, long long d) {
    l = r = 0;
    this->d = d;
    sum = len * d;
    mx = max(0ll, sum);
    pushed = 0;
  }
  void push(int l, int r) {
    if (!pushed) return;
    int m = (l + r) / 2;
    this->l->recalc(m + 1 - l, d);
    this->r->recalc(r + 1 - m, d);
    this->l->pushed = 1;
    this->r->pushed = 1;
    pushed = 0;
  }
  void upd(int l, int r, int tl, int tr, long long x) {
    if (r < tl || tr < r) return;
    if (tl <= l && r <= tr) {
      d = x;
      sum = (r - l + 1) * d;
      mx = max(0ll, sum);
      pushed = 1;
    }
    int m = (l + r) / 2;
    if (!this->l) this->l = new T(m - l + 1, d);
    if (!this->r) this->r = new T(r - m + 1, d);
    push(l, r);
    this->l->upd(l, m, tl, tr, x);
    this->r->upd(m + 1, r, tl, tr, x);
    sum = this->l->sum + this->r->sum;
    mx = max(this->l->mx, this->l->sum + this->r->mx);
  }
};
int main() {
  long long n;
  cin >> n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      return cout << (n == 1 ? i : 1), 0;
    }
  }
  cout << n;
  return 0;
}
