# coding: utf-8 # AtCoder Competition Template v2.1 SHORT (PyPy 7.3.20 / Python 3.11) ※yukicoder用に編集した物 # ↑ https://github.com/Rino-program/atcoder/blob/main/contests/.template/main.py # oj test -c 'C:\Rino-program\AtCoder\.venv-pypy311\Scripts\python.exe maina.py' -d input/a import sys import math # ===== 入出力ヘルパ ===== def input() -> str: return sys.stdin.readline().rstrip() def INT() -> int: return int(input()) def MAP(): return map(int, input().split()) def LIST() -> list[int]: return list(MAP()) def TUPLE() -> tuple[int, ...]: return tuple(MAP()) def TUPLES(n: int) -> list[tuple[int, ...]]: return [TUPLE() for _ in range(n)] # ===== 定数 ===== INF = 10 ** 18 # ===== 関数短縮 ===== pr = print en = enumerate # ===== よく使う出力関数 ===== def Yes(): print("Yes") def No(): print("No") def yn(cond: bool) -> None: """条件に応じてYes/No出力""" print("Yes" if cond else "No") # ===== デバッグ ===== def debug(*args, **kwargs) -> None: """デバッグ出力(標準エラー)""" print("[DEBUG]", *args, **kwargs, file=sys.stderr) # ============================================== # =================== main ===================== # ============================================== def main() -> None: # ここに解答を書く # 答えは意外と小さそう N = INT() ans = 0 while N != 1: ans += 1 if N % 2: N *= 3 N += 1 else: N //= 2 pr(ans) if __name__ == "__main__": main()