#include <iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

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