#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF 1<<30

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