n = int(input()) flag = True li = [n] i = 0 while flag: if li[i] == 1: print(i) flag = False if li[i] % 2 == 0: li.append(li[i]//2) else: li.append(3*li[i]+1) i += 1 print(max(li))