#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
using namespace std;
//1031
int n;
int main(){
while(scanf("%d",&n)&&n!=0){
int k=0;
while(n!=1){
if(n%2==0) n/=2;
else n=(3*n+1)/2;
k++;
}
cout<<k<<endl;
}
return 0;
}
/**************************************************************
Problem: 1031
User: cust123
Language: C++
Result: Accepted
Time:10 ms
Memory:1520 kb
****************************************************************/