Program Chuso_1;

const fi='BAI3.DB';
      fo='BAI3.ODB';
Var
     n,x,count: longint;

     f: text;

Begin
  Assign(f,fi); reset(f);
  Readln(f,n);
  count:=1; x:=1 ;
  while x * 2 +1 <=n do
   begin
     inc(count);
     x:=x*2 +1;
   end;

  assign(f,fo); rewrite(f);
  writeln(f, count);
  Close(f)

end.
