#include <iostream>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    while(n!=0){
        int count=0;
        while(n!=1){
            if(n%2==0){
                n = n/2;
                count++;
            }else{
                n = 3*n+1;
                count++;
            }
            if(n==1)break;
        }
        cout << count << endl;
        cin >>n;
    }
    return 0;
}
