#include <bits/stdc++.h>
using namespace std;
inline char get() {
  static char buf[30000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 30000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  register char c = getchar();
  register long long f = 1, _ = 0;
  while (c > '9' || c < '0') f = (c == '-') ? -1 : 1, c = getchar();
  while (c <= '9' && c >= '0')
    _ = (_ << 3) + (_ << 1) + (c ^ 48), c = getchar();
  return _ * f;
}
long long n;
long long prime[10000005], ind;
bool book[10000005];
signed main() {
  cin >> n;
  for (register long long i = 2; i <= 1e6 + 3; i++) {
    if (!book[i]) prime[++ind] = i;
    for (register long long j = 1; j <= ind; j++) {
      if (i * prime[j] > 1e6 + 3) break;
      book[i * prime[j]] = 1;
      if (!i % prime[j]) break;
    }
  }
  for (register long long i = 2; i * i <= n; i++) {
    if (n % i == 0) goto next;
  }
  printf("%lld\n", n);
  return 0;
next:;
  long long pos = -1;
  for (register long long i = 1; i < ind; i++) {
    if (prime[i] == 0) break;
    if (prime[i] > n) break;
    if (n == 1) break;
    if (n % prime[i] == 0 && pos != -1) {
      puts("1");
      return 0;
    }
    while (n % prime[i] == 0) {
      pos = prime[i];
      n /= prime[i];
    }
  }
  if (n != 1)
    puts("1");
  else
    printf("%lld\n", pos);
  return 0;
}
