#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
	
	while(true){
		
		int n;
		
		cin >> n;
		
		if(n == 0){
			break;
		}
		
		int ans = 0;
		
		while(true){
			if(n == 1){
				break;
			}
			if(n % 2 == 0){
				n /= 2;
			}else{
				n = 3 * n + 1;
			}
			ans++;
		}
		
		cout << ans << endl;;
		
	}
	return 0;
}