#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const ll mod=1e9+7;
ll memo[1000005]={0};
ll func(ll n){
  if(n==1) return 0;
  if(memo[n]!=-1) return memo[n];
  if(n%2==0) return memo[n]=func(n/2)+1;
  else return memo[n]=func(n*3+1)+1;
}
int main(){
  for(int i=0;i<1000005;i++) memo[i]=-1;
  while(1){
    ll n;
    cin>>n;
    if(n==0) return 0;
    cout<<func(n)<<endl;
  }
}

