while True: try: n = int(input()) nb = bin(n).strip("0b").split("0") print(max([len(x) for x in nb])) except: break