#include <bits/stdc++.h>
using namespace std;
int n;
int ans = 0, maxn = 0;
int c[100010] = {0};
int main() {
freopen("ant.in", "r", stdin);
freopen("ant.out", "w", stdout);
cin >> n;
for (int i = 2; i <= n; i++) {
if (c[i] == 0)
c[i] = 1;
int k = 2;
while (k * i <= n) {
k++;
c[k * i]++;
}
if (c[i] > maxn)
ans = i;
maxn = max(maxn, c[i]);
}
cout << ans << endl;
return 0;
}