#include <iostream>
#include <algorithm>

using namespace std;

int count;

int collatz(int n, int count){
  if(n == 1){
    return count;
  }
  else if(n % 2 == 0){
    return collatz(n / 2, count + 1);
  }
  else{
    return collatz(n * 3 + 1, count + 1);
  }
}


int main(){
  int n;


  while(true){
    cin >> n;
    if(!n) break;
    cout << collatz(n, 0) << endl;
  }

  return 0;
}
    