#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-4;

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		int i;
		for (i = 0; !i || n != 1; ++i)
			n = n & 1 ? 3*n+1 : n/2;
		printf("%d\n", i);
	}

	return 0;
}