#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
int main(){
  int n,cnt;
  while(1){
  cin >> n;
  if(n==0)break;
  cnt=0;
  for(;n!=1;cnt++){
    if(n%2==0) n/=2;
    else n=n*3+1;
  }
  cout << cnt << endl;
  }
}