#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define all(a) (a).begin(), (a).end()
const int MAXN = 1e6 + 1;
int D[MAXN];
bool checkCP(int n) {
int k = sqrt(n);
return (k * k == n);
}
void SangUoc(int maxn) {
D[1] = 1;
for (int i = 2; i <= sqrt(maxn); ++i) {
for (int j = i; j <= maxn / i; ++j) {
if (checkCP(i * j)) {
D[i * j]++;
}
else D[i * j] += 2;
}
}
for (int i = 2; i <= maxn; ++i) D[i] += 2;
int maxUoc = 0, result = 0;
for(int i=1;i<=maxn;++i){
if(D[i] > maxUoc){
maxUoc = D[i];
result = i;
}
}
cout<<result;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
SangUoc(n);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIGFsbChhKSAoYSkuYmVnaW4oKSwgKGEpLmVuZCgpCmNvbnN0IGludCBNQVhOID0gMWU2ICsgMTsKaW50IERbTUFYTl07CmJvb2wgY2hlY2tDUChpbnQgbikgewoJaW50IGsgPSBzcXJ0KG4pOwoJcmV0dXJuIChrICogayA9PSBuKTsKfQp2b2lkIFNhbmdVb2MoaW50IG1heG4pIHsKCURbMV0gPSAxOwoJZm9yIChpbnQgaSA9IDI7IGkgPD0gc3FydChtYXhuKTsgKytpKSB7CgkJZm9yIChpbnQgaiA9IGk7IGogPD0gbWF4biAvIGk7ICsraikgewoJCQlpZiAoY2hlY2tDUChpICogaikpIHsKCQkJCURbaSAqIGpdKys7CgkJCX0KCQkJZWxzZSBEW2kgKiBqXSArPSAyOwoJCX0KCX0KCWZvciAoaW50IGkgPSAyOyBpIDw9IG1heG47ICsraSkgRFtpXSArPSAyOwoJaW50IG1heFVvYyA9IDAsIHJlc3VsdCA9IDA7Cglmb3IoaW50IGk9MTtpPD1tYXhuOysraSl7CgkJaWYoRFtpXSA+IG1heFVvYyl7CgkJCW1heFVvYyA9IERbaV07CgkJCXJlc3VsdCA9IGk7CgkJfQoJfQoJY291dDw8cmVzdWx0Owp9CmludCBtYWluKCkgewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CgljaW4udGllKDApOwoJY291dC50aWUoMCk7CglpbnQgbjsKCWNpbj4+bjsKCVNhbmdVb2Mobik7Cn0=