#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main()
{
	while (1) {
		int a;
		cin >> a;
		if (a == 0)break;
		int b = 0;
		while (1) {
			if (a == 1)break;
			if (a % 2 == 0)a /= 2;
			else a = a * 3 + 1;
			b++;
		}
		cout << b << endl;
	}
}