#include
using namespace std;
int main(void)
{
int first;
cin>>first;
while (first!=0)
{
int lenth=1;
while(first!=1)
{
if (first%2==0)
{
first=first/2;
}
else
first=first*3+1;
lenth++;
}
cout
#include
using namespace std;
int main(void)
{
int first;
cin>>first;
while (first!=0)
{
int lenth=1;
while(first!=1)
{
if (first%2==0)
{
first=first/2;
}
else
first=first*3+1;
lenth++;
}
cout