#include <iostream>

using namespace std;

int N;

int main () {
  //freopen ("test.in", "r", stdin);
  //freopen ("test.out", "w", stdout);

  scanf ("%d", &N);
  if (__builtin_popcount (N) == 1) {
    int ans = 0;
    while (N) ans++, N >>= 1;
    printf ("%d\n", ans - 1);
  }

 // printf ("%d\n", N);
}