#include <bits/stdc++.h>
using namespace std;
int a[1000],s,c,x,maxx=0;
int main(){
int n;
cin>>n;
for(int i=1;i<=n/2;i++){
for(int j=1;j<=n;j++){
if(i%j==0){
s++;
}
}
if(s==2){
c++;
a[c]=i;
}
s=0;
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(a[i]*a[j]==n){
x=max(a[i],a[j]);
}
if(x>maxx){
maxx=x;
}
}
}
cout<<maxx;
return 0;
}