#include <iostream>
using namespace std;
int col(int n){
  if(n%2)
    return 3*n+1;
  else
    return n/2;
}
int main(){
  int n,s;
  while(true){
  cin>>n;
  if(!n)
    break;
  s = 0;
  while(n!=1){
    n = col(n);
    s++;
  }
  cout<<s<<endl;
  }
  return 0;
}