var
T,N,i,e:longint;
begin
     assign(input,'weighing.in'); reset(input);
     read(T);

      for i:=1 to T do
          begin
          read(N);
          e:=0;
            while n>1 do
            begin
            if N mod 2=0 then begin
            N:=N div 2;
            e:=e+1; end
            else
            n:=n-1;
            end;
            writeln(e);
          end;


end.

