#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int gcd_vector(vector<long long int> vec) {
  long long int result{};
  for (int i{1}; i < int(vec.size()); ++i) {
    result = gcd(result, vec[i]);
    if (result == 1) return 1;
  }
  return result;
}
long long int digit_sum(long long int n) {
  long long int sum{};
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int get_prime_count(int a) {
  int t = a;
  int count{};
  for (int i{2}; i * i <= a; ++i) {
    if (a % i == 0) {
      ++count;
      while (a % i == 0) {
        a /= i;
      }
    }
  }
  if (a > 1 && a != t) ++count;
  return count;
}
class Graph {
 public:
  int V;
  list<int>* adj;
  Graph(int v) {
    V = v;
    adj = new list<int>[V];
  }
  void add_edge(int u, int v) {
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  void dfs(int s) {
    bool visited[V];
    for (int i{}; i < V; ++i) visited[i] = false;
    dfs_util(s, visited);
  }
  void dfs_util(int s, bool visited[]) {
    cout << s << " ";
    visited[s] = true;
    for (auto val : adj[s]) {
      if (!visited[val]) {
        dfs_util(val, visited);
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(0) << fixed;
  int t{};
  t = 1;
  while (t--) {
    long long int n{};
    cin >> n;
    long long int temp = n;
    vector<int> vec;
    for (long long int i{2}; i * i <= n; ++i) {
      if (n % i == 0) {
        vec.push_back(i);
        if (vec.size() >= 2) break;
        while (n % i == 0) n /= i;
      }
      if (vec.size() >= 2) break;
    }
    if (n > 1 && n != temp) vec.push_back(n);
    if (vec.size() >= 2)
      cout << 1;
    else if (vec.size() == 1)
      cout << vec[0];
    else
      cout << n;
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
