#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,count;
    count=0;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            while (n>1) {
                if (n%2==0) {
                    n=n/2;
                    count++;
                } else {
                    n=n*3+1;
                    count++;
                }
            }
        }
        cout<<count<<endl;
        count=0;
    }
}

