#include<iostream>
using namespace std;

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