#include <iostream>
#include <algorithm>
using namespace std;

#define MAX 1000002

int step[MAX];

int getStep(int n){
  if(n == 1) return 0;
  if(step[n] != -1) return step[n];

  int next;
  if(n % 2 == 0) next = n / 2;
  else           next = n * 3 + 1;

  return step[n] = getStep(next) + 1;
}

int main(){
  int n;
  fill(step, step + MAX, -1);

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