/**
* @author lihanhan
*
*/
/**
*算法第四版1.1.14
*/
import java.util.Scanner;
public class Main {
public static int lg(double N) {
//log2|N=K 2^k=N
int k=0;
if(N>0&&N<1) {
double count=1;
while(count>=N) {
count*=1/2.0;
k-=1;
}
return k+1;
}
else if(N>=1) {
int count =1;
while(count<N) {
count*=2;
k+=1;
}
return k-1;
}
else {
return -1;
}
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while(sc.hasNext()) {
double N=sc.nextDouble();
System.out.println(lg(N));
}
}
}