#C8305. Longest Contiguous Ones

    ID: 52273 Type: Default 1000ms 256MiB

Longest Contiguous Ones

Longest Contiguous Ones

Given a binary string (S) consisting of characters '0' and '1', your task is to compute the length of the longest contiguous sequence of '1's in (S). For example, if (S = "110011111011"), the longest contiguous sequence of '1's has length 5. The answer should be output as an integer.

Input is provided via standard input (stdin) and the result should be printed to standard output (stdout).

inputFormat

The input consists of a single line that contains a binary string (S) (i.e., a string containing only characters '0' and '1'). Note: (S) may be empty.

outputFormat

Print a single integer representing the length of the longest contiguous sequence of '1's in the given string.## sample

110011111011
5