#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } vector<ll> a; for (ll i = 2; i * i <= n; i++) { if (n % i == 0) { a.push_back(i); while (n % i == 0) n /= i; } } if (n != 1) a.push_back(n); if (a.size() > 1) cout << 1 << endl; else cout << a.front() << endl; return 0; }