#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pb push_back

using namespace std;

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