#include <iostream>

using namespace std;

int collatz( int num )
{
	if( num == 1 ) return 0;
	if( num%2 == 0 ) return 1+collatz(num/2);
	else return 1+collatz(num*3+1);
}

int main(void)
{
	int n;
	while( cin >> n ){
		if( n == 0 ) break;
		cout << collatz(n) << endl;
	}
	return 0;
}