#include <iostream>
#include <math.h>
usingnamespace std;
int main(){
int a, num;
cin>>a;
for (int i=0; i<a; i++){
/*if (X modulo 2 = 0) then
Xnext = X / 2
else
Xnext = 3 * X + 1 */
cin>>num;
int steps =0;
do { steps++;
int b = num%2;
if (b =0)
num/=2;
else
num=3*num+1;
} while (num!=1);
cout<<steps<<" ";}
}