#include <iostream> using namespace std; int main() { int a, b; while (cin >> a) { // 注意 while 处理多个 case // cout << a + b << endl; if (a == 0) { return 0; } b = 0; while (a != 1) { if (a % 2 == 0) { a /= 2; b++; } else { a = (a*3 + 1) / 2; b++; } } cout << b <<endl; } } // 64 位输出请用 printf("%lld")