#include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int n,i,x;
	scanf("%d",&n);
	x=1;
	i=1;
	while(x<=n)	{
		x=x*2+1;
		i++;
	}
	i--;
	printf("%d\n",i);
	return 0;
}
