#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
using namespace std;
int main(void) {
	for (;;) {
		int cnt = 0,buf;
		cin >> buf;
		if (!buf)return 0;
		for (; buf != 1;) {
			buf = buf % 2 ? buf / 2 : buf * 3 + 1;
			cnt++;
		}
		cout << cnt << endl;
	}
}