s = gets.to_i
N = 10 ** 6

arr = []
for i in 1..N do
  if i == 1 then
    arr[i-1] = s
  elsif arr[i-2] % 2 == 0 then
    arr[i-1] = arr[i-2] / 2
  else
    arr[i-1] = 3 * arr[i-2] + 1
  end
end
    
deja = []
for i in 1..N do
  deja[i-1] = false
end
    
m = 1
loop do
  num = arr[m-1]
  if deja[num-1] then
    puts m
    break
  else
    deja[num-1] = true
  end
  m += 1
end