#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

int solve(int n)
{
	int ret = 0;

	while (n != 1)
	{
		if (n % 2 == 0)
		{
			n /= 2;
		}
		else if (n % 2 == 1)
		{
			n = n * 3 + 1;
		}
		ret++;
	}

	return ret;
}

signed main()
{
	int n;

	while (true)
	{
		cin >> n;
		if (n == 0) break;
		printf("%d\n", solve(n));
	}
}