def main(): N = int(input()) hit = 0 biscuit = 1 while biscuit * 2 <= N: biscuit = biscuit * 2 hit += 1 while (N - biscuit) > 0: biscuit += (N - biscuit) * 2 hit += 1 print(hit) if __name__ == '__main__': main()