#include <iostream>
using namespace std;

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