#include<bits/stdc++.h>
using namespace std;
int x;
int s,t,m=0x7fffffff;
void f(int a){
int c=a;
for(int i=2;i<a>>1;i++){
if(!(c%i)){
s++;
m=min(m,i);
while(!(c%i)){
c/=i;
t++;
}
}
}
if(!s){
s++;
t++;
m=a;
}
}
int main(){
cin>>x;
f(x);
if(s==1){
cout<<x;
}else if(t%2&&s==t){
cout<<m;
}else{
cout<<1;
}
return 0;
}
https://www.luogu.com.cn/record/158066560