#include<iostream>

using namespace std;

int main(){

  int in;
  
  while(1){

    cin >> in;

    if(in == 0) break;

    int sum = 0;

    while(in != 1){
      if(in % 2 == 0){
	in /= 2;
	sum++;
      }else{
	in = in*3+1;
	sum++;
      }
    }
    cout << sum << endl;

  }

  return 0;
}