#include <bits/stdc++.h>
using namespace std;
#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define MP(a, b) make_pair(a, b)
#define F first
#define S second
#define INF 1 << 30

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

long long n, m;
vector<pi>s;
int dp[1024];

int main(){
  while(scanf("%d", &n)){
	  if(!n)break;
	  int cnt=0;
	  while(n!=1){
	  if(n%2==0){n=n/2;cnt++;}
	  else{n=n*3+1;cnt++;}
	  }
	  printf("%d\n",cnt);
  }
  return 0;
}