#include<bits/stdc++.h>
using namespace std;
#define PROBLEM "B"
bool check[1000010];
int odd(int n){
	return 3*n + 1;
}
int even(int n){
	return n/2;
}
int main(){
	#ifdef DBG
	freopen("problem" PROBLEM ".in", "r", stdin);
	freopen("problem" PROBLEM ".out", "w", stdout);
	#endif
	memset(check, 0, sizeof(check));
	int n;
	int count = 0;
	while(cin >> n){
		while(!check[n]){
			check[n] = true;
			if(n % 2 == 0)
				n = even(n);
			else
				n = odd(n);
			count++;
		}
		cout << count+1 << endl;
	}
	return 0;
}