n = int(input())
b = bin(n)
b = b[2:].split('0')
print(max([len(i) for i in b]))