#include<bits/stdc++.h>
using namespace std;
#define int long long
int memo[1111111];
int dfs(int v){
  if(~memo[v]) return memo[v];
  if(v==1) return 0;
  if(v%2) return dfs(v*3+1)+1;
  else return dfs(v/2)+1;
}
signed main(){
  memset(memo,-1,sizeof(memo));
  int n;
  while(cin>>n,n) cout<<dfs(n)<<endl;
  return 0;
}