#include <iostream>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main(){
	int n;
	while(cin >> n, n) {
		int ret = 0;
		while(1) {
			if(n==1) break;
			if(n%2==0) {
				n/=2;
				ret++;
			} else {
				n = n*3+1;
				ret++;
			}
		}
		cout << ret << endl;
	}
	return 0;
}