#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
bool judge (int x) {
for (int i = 2;i < (int) sqrt(x);i++) {
if (x % i == 0) {
return false;
}
}
return true;
}
int main () {
int n;
cin >> n;
for (int i = 2;i < n;i++) {
int j = n / i;
if (i * j == n) {
if (judge(i) && judge(j)) {
cout << j << endl;
return 0;
}
}
}
return 0;
}