#include <cstdio>
#include <algorithm>
using namespace std;

int main()  {

    int n, step;
    for (; ;) {
        scanf("%d", &n);
        if (n == 0) break;
        step = 0;
        while (n != 1) {
            if (!(n & 1)) n /= 2;
            else n = n * 3 + 1;
            step++;
        }
        printf("%d\n", step);
    }
    return 0;
}

