#include <bits/stdc++.h>
using namespace std;
long long n, ans, cnt;
int vis[1000050];
int main() {
  scanf("%lld", &n);
  for (int i = 2; i <= 1000000; i++)
    if (!vis[i]) {
      if (n % i == 0) {
        while (n % i == 0) n /= i;
        cnt++;
        ans = i;
      }
      for (int j = 2; i * j <= 1000000; j++) vis[i * j] = 1;
    }
  if (cnt == 1 && n == 1)
    printf("%lld\n", ans);
  else if (cnt == 0)
    printf("%lld\n", n);
  else
    printf("1\n");
  return 0;
}
