#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"

map<long long int, int>mp;
int getans(const long long int n) {
	if (n < 0)assert(false);
	if (mp.find(n) != mp.end())return mp[n];
	else {
		int ans = n==1?0:n % 2 ? (1 + getans(3 * n + 1)) : (1 + getans(n / 2));
		return mp[n] = ans;
	}
}

int main() {
	while (1) {
		long long int N; cin >> N;
		if (!N)break;
		int ans = getans(N);
		cout << ans << endl;
	}
	return 0;
}