#include <iostream>
using namespace std;

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