#include<bits/stdc++.h>

using namespace std;

int main()
{

  while(1){
    int num;
    cin>>num;
    if(num == 0){
      break;
    }

    int ans = 0;
    while(1){

      if(num % 2 == 0){
        num = num / 2;
      }
      else{
        num = 3 * num + 1;
      }

      ++ans;

      if(num == 1){
        break;
      }
    }

    cout<<ans<<endl;
  }
  
  return 0;
}
