import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) for i in range(10 ** 9): if n == 1: print(i) break if n % 2 == 0: n //= 2 else: n += 1