include

include

using namespace std;
int main() {
int n, steep;
while (scanf("%d\n",&n)!=EOF) {
if(n==0)
break;
steep = 0;
while (n != 1) {
if (n % 2 == 0) {
n = n / 2;
steep++;
}
else {
n = (n * 3 + 1) / 2;
steep++;
}
}
printf("%d\n",steep);
}
return 0;
}