#include <bits/stdc++.h>
const int N = 1000005;
using namespace std;
inline long long Getint() {
  register long long x = 0, f = 1;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int prime[N];
bool vis[N];
int main() {
  for (int i = 2; i <= 1e6; i++) {
    if (!vis[i]) prime[++prime[0]] = i;
    for (int j = 1; j <= prime[0] && i * prime[j] <= 1e6; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
  long long n = Getint(), lwp = n;
  if (n == 1) cout << 1, exit(0);
  for (int i = 1; i <= prime[0] && prime[i] <= n; i++)
    if (n % prime[i] == 0) {
      lwp = prime[i];
      break;
    }
  long long t = n;
  while (t % lwp == 0) t /= lwp;
  if (t == 1)
    cout << lwp;
  else
    cout << 1;
  return 0;
}
