#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  while( 1 ) {
    int n;  
    cin >> n;
    if( !n ) { return EXIT_SUCCESS; }

    int i;
    for( i = 0; n != 1; i++ ) {
      n = ( n % 2 ? n * 3 + 1 : n / 2 ); 
    }
    cout << i << endl;
  }
}