#include <bits/stdc++.h>
int main() {
  long long int n, a = -1;
  std::cin >> n;
  for (int i = 2; i <= 1000000; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      if (n > 1)
        a = 1;
      else
        a = i;
      break;
    }
  }
  std::cout << ((a == -1) ? n : a);
  return 0;
}
