{$APPTYPE CONSOLE}
var t,n,m,i:longint;
begin
  assign(input, 'WEIGHING.IN'); reset(input);
  readln(t);
  for i:=1 to t do
   begin
     readln(n);
     if (n=1) or (n=0) then writeln
                       else begin
     m:=0;
     if n mod 2<>0 then n:=n-1;
     repeat
     n:=n div 2;
     m:=m+1;
     if n mod 2<>0 then n:=n-1;
     until n=0;
     writeln(m);             end;
   end;
end.