#include <iostream>
#include <set>
using namespace std;

int main() {
	int s;
	set<int> S;
	cin >> s;
	int i = 1;
	while (S.find(s) == S.end()) {
		S.insert(s);
		i++;
		s = (s % 2 == 0 ? s / 2 : 3 * s + 1);
	}
	cout << i << endl;
}