import bisect

import os

from collections import Counter, deque

from fractions import gcd

from functools import lru_cache

from functools import reduce

import functools

import heapq

import itertools

import math

import numpy as np

import re

import sys



if os.getenv("LOCAL"):

    sys.stdin = open("_in.txt", "r")



sys.setrecursionlimit(2147483647)

INF = float("inf")



s = int(sys.stdin.readline())

hist = {s}

i = 2

while True:

    if s % 2 == 0:

        s //= 2

    else:

        s = s * 3 + 1

    if s in hist:

        print(i)

        break

    hist.add(s)

    i += 1

import os

import sys



if os.getenv("LOCAL"):

    sys.stdin = open("_in.txt", "r")



sys.setrecursionlimit(10 ** 9)

INF = float("inf")

IINF = 10 ** 18

MOD = 10 ** 9 + 7

# MOD = 998244353



S = int(sys.stdin.buffer.readline())



seen = [0] * 1000001



a = S

i = 0

while not seen[a]:

    seen[a] = 1

    if a % 2 == 0:

        a //= 2

    else:

        a = 3 * a + 1

    i += 1

print((i + 1))

import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(2147483647)
INF = float("inf")
s = int(sys.stdin.readline())
hist = {s}
i = 2
while True:
    if s % 2 == 0:
        s //= 2
    else:
        s = s * 3 + 1
    if s in hist:
        print(i)
        break
    hist.add(s)
    i += 1

import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10**9)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
# MOD = 998244353
S = int(sys.stdin.buffer.readline())
seen = [0] * 1000001
a = S
i = 0
while not seen[a]:
    seen[a] = 1
    if a % 2 == 0:
        a //= 2
    else:
        a = 3 * a + 1
    i += 1
print((i + 1))

-import bisect -from collections import Counter, deque -from fractions import gcd -from functools import lru_cache -from functools import reduce -import functools -import heapq -import itertools -import math -import numpy as np -import re -sys.setrecursionlimit(2147483647) +sys.setrecursionlimit(10**9) -s = int(sys.stdin.readline()) -hist = {s} -i = 2 -while True: -    if s % 2 == 0: -        s //= 2 +IINF = 10**18 +MOD = 10**9 + 7 +# MOD = 998244353 +S = int(sys.stdin.buffer.readline()) +seen = [0] * 1000001 +a = S +i = 0 +while not seen[a]: +    seen[a] = 1 +    if a % 2 == 0: +        a //= 2 -        s = s * 3 + 1 -    if s in hist: -        print(i) -        break -    hist.add(s) +        a = 3 * a + 1 +print((i + 1))