#include<iostream>
using namespace std;

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

  return 0;
}