#include<iostream>
using namespace std;
int main(){
  int t,bell;
  while(1){
    t=0;
    cin >> bell;
    if(bell==0){
      break;
    }
    while(bell!=1){
      t++;
      if(bell%2==0){
	bell/=2;
      }
      else{
	bell*=3;
	bell++;
      }
    }
    cout << t << endl;
  }
}