#include<iostream>
using namespace std;

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