#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>
#include <math.h>
#include <numeric>
#include <set>

using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;


int main()
{
	int n;
	while (cin >> n, n){
		int ans(0);

		while (n != 1){
			if (n & 1){
				n *= 3;
				++n;
			}
			else{
				n /= 2;
			}
			++ans;
		}
		cout << ans << endl;
	}

	return 0;
}