n = io.read("*n") c = 0 while(n ~= 1) do if(n % 2 == 1) then n = n + 1 else n = n / 2 end c = c + 1 end io.write(c)