• + 17 comments

    Simple way for Python3:

    print(len(max(bin(int(input().strip()))[2:].split('0'))))