#include using namespace std; int main() { int nokori; cin >> nokori; int kaisu, temochi; temochi = 1; kaisu = 0; if (nokori == 1) { cout << 0 << endl; return 0; } while (true) { //持ってる枚数で1から総当たりチェック for (int i = 1; i <= temochi; i++) { if (nokori == (i * 2) + (temochi - i)) { cout << kaisu + 1 << endl; return 0; } } kaisu++; temochi *= 2; } return 0; }