S = bin(int(input()))[2:] if list(S).count('1') == 1: print(len(S) - 1) else: print(len(S))