n = int(input()); b = str(bin(n))[2:]; w = int(len(b)); if (2**(w-1) == n): print(w-1); else: print(w);