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