#include<stdio.h>
int coll(int x)//定义函数
{int count=0;while(x>1){if(x%2==0){x=x/2;count++;}else{x=3*x+1;count++;}}return count;
}
int main()
{int n,num;scanf("%d",&n);int arr[n+1];for(int i=1;i<=n;i++)//输入n组数据保存到数组中{scanf("%d",&arr[i]);}for(int j=1;j<=n;j++)//循环打印数组中每一个数对应的步数{int len=coll(arr[j]);printf("%d\n",len);}return 0;
}