#include <iostream>
using namespace std;

main(){
  int i,j,n,c;
  while(1){
    cin >> n;
    c = 0;
    if(n == 0) break;
    while(n != 1){
      if(n % 2 == 0){
	n /= 2;
	c++;
      }
      else{
	n *= 3;
	n += 1;
	c++;
      }
    }
    cout << c << endl;
  }

  return 0;
}