#include using namespace std; int main(){ int N; cin >> N; N++; int count = 0; while(N != 1){ N /= 2; count++; } cout << count << endl; }