# coding: UTF-8

import sys

#sys.setrecursionlimit(n)

import heapq

import re

import bisect

import random

import math

import itertools

from collections import defaultdict, deque

from copy import deepcopy

from decimal import *



d = defaultdict(int)

s = int(eval(input()))

d[s] = 1

index = 1

while(1):

    if s % 2 == 0:

        s = s // 2

    else:

        s = 3 * s + 1

    index += 1

    if d[s] == 1:

        break

    d[s] = 1

print(index)





from collections import defaultdict, deque

s = int(eval(input()))

d = defaultdict(int)

d[s] = 1

index = 1

while(1):

  if s % 2 == 0:

    s = s // 2

  else:

    s = 3 * s + 1

  index += 1

  if d[s] == 1:

    break

  d[s] = 1

print(index)

# coding: UTF-8
import sys

# sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

d = defaultdict(int)
s = int(eval(input()))
d[s] = 1
index = 1
while 1:
    if s % 2 == 0:
        s = s // 2
    else:
        s = 3 * s + 1
    index += 1
    if d[s] == 1:
        break
    d[s] = 1
print(index)

from collections import defaultdict, deque

s = int(eval(input()))
d = defaultdict(int)
d[s] = 1
index = 1
while 1:
    if s % 2 == 0:
        s = s // 2
    else:
        s = 3 * s + 1
    index += 1
    if d[s] == 1:
        break
    d[s] = 1
print(index)

-# coding: UTF-8 -import sys +from collections import defaultdict, deque -# sys.setrecursionlimit(n) -import heapq -import re -import bisect -import random -import math -import itertools -from collections import defaultdict, deque -from copy import deepcopy -from decimal import * - +s = int(eval(input())) -s = int(eval(input()))