#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int> > fac(int x)
{
vector<pair<int,int> >f;
for (int p=2;p<=sqrt(x);p++)
{
if(x%p==0)
{
int cnt=0;
while(x%p==0)
{
x/=p;
cnt++;
}
f.emplace_back(p,cnt);
}
}
if (x>1)
{
f.emplace_back(x,1);
}
return f;
}
int main()
{
int x;
cin>>x;
vector<pair<int,int> > f=fac(x);
int res=1;
for (auto [p,a]:f)
{
res=pow(p,a);
}
cout<<res<<endl;
return 0;
}