#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int dp[1000002];

int solve(int n){
  if(n == 1) return 0;
  if(dp[n] != -1) return dp[n];

  return dp[n] = (solve(n%2==0 ? n/2 : n*3+1) + 1);
}

int main(){
  int n;
  memset(dp,-1,sizeof(dp));

  while(cin>>n,n){
    cout<<solve(n)<<endl;
  }
}