#include <bits/stdc++.h>
using namespace std;
bool is_prime(long long int n) {
  long long int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i++;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  if (n % 2 == 0) {
    while (n % 2 == 0) {
      n = n / 2;
      if (n == 0 || n == 1) {
        cout << 2;
        return 0;
      }
    }
    cout << 1;
    return 0;
  } else {
    if (is_prime(n)) {
      cout << n;
    } else {
      long long int k = 3;
      while (n % k != 0) {
        k += 2;
      }
      long long int p = 1;
      while (n > p) {
        p = p * k;
      }
      if (p == n) {
        cout << k;
      } else {
        cout << 1;
      }
    }
  }
  return 0;
}
