#include <stdio.h>

int main(void){
    int times;
    int n;
    
    while (scanf("%d", &n), n!=0){
        times=0;
        while (n!=1){
            n = n%2 ? 3*n+1 : n/2;
            times++;
        }
        printf("%d\n", times);
    }
    
    return 0;
}