#include<iostream>
//#include<algorithm>
//#include<cmath>
//#include<string>
//#include<cctype>
#include <vector>
using namespace std;
int main() {
	int n;
	while (cin >> n) {
		if (n == 0)break;
		int c = 0;
		while (n != 1)
			n = n % 2 ? n * 3 + 1 : n / 2, c++;
		cout << c << endl;
	}
	return 0;
}