#include<iostream>
using namespace std;

int main(){
  int n;
  int c;

  while(1){
    cin >> n;
    if(!n)break;

    c = 0;
    while(1){
      if(n==1)break;

      if(n%2){
	n*=3;
	n++;
      }else{
	n/=2;
      }
      c++;
    }

    cout << c << endl;
  }
}