#include<cstdio>
using namespace std;
int main(){
    int n;

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