#include<iostream>
using namespace std;
int main()
{
	int n, i;
	i = 0;
	while(1)
		{
			cin >> n;
			if ( n == 0 )break;
			else
			{
				while(1)
				{
						if ( n == 1 )break;
						else if ( n % 2 == 1 )
						{
							n = (n * 3) + 1;
							i++;
						}
					else if ( n % 2 == 0 )
						{
							n = n / 2;
							i++;
						}
				}
			cout << i << endl;
			i = 0;
			}	
		}
	return 0;
}