#include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;




/** Problem0158 : Collatz's Problem **/
int main()
{
	int n;
	
	while (cin>>n, n!=0) {
		int i=0;
		while (n!=1) {
			if (n%2==0)
				n/=2;
			else
				n=n*3+1;
			i++;
		}
		cout << i << endl;
	}
	return 0;
}