import re def one_continue(n): #转换二进制 bin_n = bin(n)[2:] #z正则表达式空格替换0 new_one = re.sub(r'0+',' ',bin_n) one_dist = new_one.split() max_len = max(one_dist,key = len) return len(max_len) n = int(input().strip()) print(one_continue(n))