s = gets.chomp.to_i
ary = [s]

tmp = s + 0
count = 1
while true
  count += 1
  if tmp % 2 == 0
    tmp /= 2
  else
    tmp = tmp * 3 + 1
  end
  if ary.find {|item| item == tmp}
    puts count
    break
  end
  ary << tmp
end
