#include <iostream>

using namespace std;

bool even(int n) {
    if (n % 2 == 0) return true;
    return false;
}

int count(int n, int acc) {
    if (n==1) return acc;
    if (even(n)) {
        return count(n/2, acc+1);
    }
    return count(n*3+1, acc+1);
}

int main() {
    int n;
    while (cin >> n) {
        if (n == 0) break;
        cout << count(n, 0) << endl;
    }
    return 0;
}