• + 0 comments
    nb=bin(n)[2:]
    nb=nb.split('0')
    m=0    
    for i in nb:
        if len(i)>m:
            m=len(i)
    print(m)
            
    				
    				
    				
    				
    				
    				ANOTHER CODE
    				
    				
    				
    n=int(input())
    nb=bin(n)[2:]
    c,m=0,0
    for i in range(len(nb)):
        if nb[i]=='1':
            c+=1
            if c>m:
                m=c
        else:
            c=0
    print(m)