#include using namespace std; typedef pair pii; int n, ans; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; if (n == 1) { cout << 0 << endl; return 0; } if (n % 2 != 0) { n += 1; cout << n/2 + 1 << endl; } else { cout << (int)(log2(n)) << endl; } }