n = int(input()) n_b = bin(n)[2:] #print(n_b) ls = sorted(n_b.split('0'),key = lambda x :len(x)) #按x的长度排序,sorted()默认的是升序 print(len(ls[-1]))