'''
用‘0’分割,之后计算生成的列表中字符串的长度
'''
i = str(bin(int(input())))
tem = []
lt = i[2:].split('0')
for k in lt:
    j = len(k)
    tem.append(j)
print(sorted(tem)[::-1][0])