s = gets.to_i
cnt = 1
arr = [s]
if (s == 2) || (s==1)
  puts 4
  exit
else
  while true
    if arr[cnt-1].even?
      arr << arr[cnt-1] / 2
      cnt += 1
    else arr[cnt-1]
      x = arr[cnt-1]*3
      x += 1
      arr << x
      cnt += 1
    end
  break if arr.index(4)
  end
end

p arr.index(4) + 4
