n = int(input())
b = bin(n)[2:]
ls = sorted(set(b.split('0')),key=lambda x:len(x))
print(len(ls[-1]))