#include<iostream>
#include<vector>
using namespace std;
int main() {
	int a;
	vector<int>l;
	while (cin >> a){
		if (a == 0) 
			break;
		int x = 0;
		while (a != 1){
			if (a % 2 == 1)
				a = a * 3 + 1;
			else a /= 2;
			x += 1;
		}
		l.push_back(x);
	}
	for (int i = 0; i != l.size(); i++)
	{
		cout << l[i] << endl;
	}
}