#include<iostream>
int t(int n){for(int p=0;;++p){if(n==1)return p;n=(n%2)?3*n+1:n/2;}}int main(){int a,i=0,b[99];std::cin>>a;for(;i<a;++i)std::cin>>b[i];for(i=0;i<a;++i)std::cout<<t(b[i])<<'\n';}
int t(int n){for(int p=0;;++p){if(n==1)return p;n=(n%2)?3*n+1:n/2;}}int main(){int a,i=0,b[99];std::cin>>a;for(;i<a;++i)std::cin>>b[i];for(i=0;i<a;++i)std::cout<<t(b[i])<<'\n';}