def solve(): N = int(input()) count = 0 while True: if N == 1: break else: if N % 2 == 0: N = N//2 count += 1 else: N = N+1 count += 1 print(count) if __name__ == "__main__": solve()