num = int(input()) ans = 0 cnt = 0 while num != 0: if num % 2 == 1: cnt += 1 ans = max(ans, cnt) else: cnt = 0 num //= 2 print(ans)