#include <bits/stdc++.h>
using namespace std;
long long n, fir;
int main() {
  scanf("%lld", &n);
  fir = n;
  for (int i = 2; 1ll * i * i <= n; i++)
    if (n % i == 0) {
      fir = i;
      break;
    }
  for (; n != 1 && n % fir == 0; n /= fir)
    ;
  printf("%lld\n", n == 1 ? fir : 1);
}
