def main(): N = int(input()) if N == 1: print(0) return x = 1 n = 0 while x < N: x *= 2 n += 1 if x == N: print(n) else: while x > N: x -= 1 n += 1 print(n) main()