#include<bits/stdc++.h>
using namespace std;
queue<int> q;
int n, cnt, c;
bool f(int m) {
while(q.size()){
q.pop();
}
for (int i = 1; i <= 2 * n; i++) {
q.push(i);
}
while (q.size()) {
int x = q.front();
q.pop();
cnt++;
if (cnt % m == 0) {
if (x > n) {
c++;
}
if (x == 1) {
if (c == x) {
return 1;
} else {
return 0;
}
}
} else {
q.push(x);
}
}
}
int main() {
cin >> n;
int i = 2;
while (1) {
if (f(i) == 1) {
break;
}
i++;
}
cout << i;
}