#include<iostream>
#include<algorithm>
using namespace std;

int main(){

  long long int n;

  while(cin >> n, n){
    int count = 0;
    while(1){
      if(n == 1) break;
      if(n%2 == 0){
	n = n/2;
	count++;
      }
      else if(n%2 == 1){
	n = n*3 + 1;
	count++;
      }
    }

    cout << count << endl;
  }
}