#include <bits/stdc++.h>
using namespace std;
int N, arr[35];
int main(void) {
  scanf("%d", &N);
  arr[0] = 1;
  arr[1] = 1;
  arr[2] = 2;
  arr[3] = 4;
  int k = 4, pos = 4;
  while (k <= 1e9) {
    k *= 2;
    arr[pos] = k;
    pos++;
  }
  k = upper_bound(arr + 1, arr + pos, N) - arr;
  if (N == 1)
    printf("1");
  else if (N == 2)
    printf("2");
  else
    printf("%d", k - 1);
}
