• + 0 comments

    python3

    n = int(input())
    s = str(bin(n))
    l = []
    ss = 0
    for i in s:
        if i == '1':
            ss += 1
            l.append(ss)
        elif i == '0':
            ss = 0
    print(max(l))