def main(): n = int(input()) b = bin(n)[2:] print(len(b)-1 + (1 if b.count("1") > 1 else 0)) if __name__ == '__main__': main()