#include<iostream>
#include<algorithm>
using namespace std; 
int main(){
	int n;
	cin>>n;
	int x=1;
	int a[500000]={0};
	a[n]=1;
	while(a[n]!=2){
		x++; 
		if(n%2==0)
		{n=n/2;
		a[n]++;}
		else
		{n=n*3+1; 
		a[n]++;}
		//cout<<n;
	} 
	cout<<x;
}