import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) def f(N): if N == 1: return 0 if N % 2 == 0: return f(N//2) + 1 return f(N+1) + 1 print(f(N))