/*
	0158:Collatz's Problem
*/
#include	<iostream>

using namespace std;

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