#include <iostream>
using namespace std;


int main(int argc, const char * argv[]) {
    
    while (true) {
        int n;
        cin >> n;
        if(n==0){
            break;
        }
        
        int count=0;
        while (true) {
            if(n == 1){
                break;
            }
            else if(n % 2 == 0){
                n /= 2;
            }
            else{
                n = 3*n + 1;
            }
            
            count++;
        }
        
        cout << count << endl;
    }
    
    return 0;
}