#include<iostream>
using namespace std;

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

}