import std.stdio, std.string, std.conv;
void main()
{
  while(1){
    auto n = readln.chomp.to!int;
    int cnt;
    if(n==0) break;
    while(n!=1){
      if(n%2==0)
	n/=2;
      else
	n = n*3+1;
      cnt++;
    }
    cnt.writeln;
  }
}