s = gets.chomp.to_i

arr = Array.new(10**6 + 1, false)

i = 1
a = s
arr[a] = true
i += 1

while true
  if a.even?
    a /= 2
  else
    a = a * 3 + 1
  end
  if arr[a]
    puts i
    exit
  else
    arr[a] = true
  end
  i += 1
end
