#include<iostream>
using namespace std;

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