#include <iostream>using namespace std; int main (){ int N; while (1) { cin>>N; if (N==0) break; int count=1; while (N!=1) { if (N%2==0) N=N/2; else N=(N*3)+1; count++; } cout<<count<<endl; } return 0;}