#include<iostream>
using namespace std;

int main(){

	int n, cnt;
	
	while(cin >> n){
		if(n == 0) break;
		cnt = 0;
		
		if(n == 1){
			cout << '0' << endl;
			continue;
		} 
		
		while(1){
			if(n % 2 == 0) n /= 2;
			else n = 3 * n + 1;
			cnt++;
			if(n == 1) break;
		}
		
		cout << cnt << endl;
	}

	return 0;

}