var num = +(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
var odds = (n) => { return n >> 1; };
var ends = (n) => { return 3 * n + 1; };
var r = [num], i;

while (num > 4) {
  num = (num % 2 == 0 ? odds(num) : ends(num));
  i = r.lastIndexOf(num);
  // console.log(i);
  if (i > -1) {
    // console.log(r);
    console.log(r.length + 1);
    return;
  }
  r.push(num);
}
console.log(r);