#!/bin/python3

import math
import os
import random
import re
import sys



if __name__ == '__main__':
    n = int(input())
    s = str(bin(n))
    k = 0
    m = 0
    
    for i in range(2,len(s)):
        if int(s[i]) == 1 :   
            k+=1
            if k>=m:
                m = k
        else:
            k=0
        
    print(m)

20873726516e633a271f4de0ca2aeeeadf7cbd75
<mask token>

<mask token>
if __name__ == '__main__':
    n = int(input())
    s = str(bin(n))
    k = 0
    m = 0
    for i in range(2, len(s)):
        if int(s[i]) == 1:
            k += 1
            if k >= m:
                m = k
        else:
            k = 0
    print(m)

import math
import os
import random
import re
import sys
if __name__ == '__main__':
    n = int(input())
    s = str(bin(n))
    k = 0
    m = 0
    for i in range(2, len(s)):
        if int(s[i]) == 1:
            k += 1
            if k >= m:
                m = k
        else:
            k = 0
    print(m)

#!/bin/python3

import math
import os
import random
import re
import sys



if __name__ == '__main__':
    n = int(input())
    s = str(bin(n))
    k = 0
    m = 0
    
    for i in range(2,len(s)):
        if int(s[i]) == 1 :   
            k+=1
            if k>=m:
                m = k
        else:
            k=0
        
    print(m)
