#include<iostream>
using namespace std;

int main(){
   int n,y;

   while(1){
	int con=0;

	cin >> n;
	if(n == 0) break;
	y = n;

	while(1){
		if(y == 1) break;

		if(y%2 == 0){
			y = y/2;
		}else{
			y = y*3 + 1;
		}

		con++;

	}

	cout << con << endl;

   }

   return 0;

}


   


	