while True: try: print(max(len(i) for i in bin(int(input()))[2:].split('0'))) # [2:]是为了消除二进制前面的0b except: break