#!/bin/python3

import math
import os
import random
import re
import sys

if __name__ == '__main__':
    n = int(input())
    #print(format(n,"b"))
    nb = format(n,"b")
    nb1 = nb.split('0')
    #print(nb1)
    nb1max = len(max(nb1))
    print(nb1max)


