#C9808. Longest Zero Sequence

    ID: 53942 Type: Default 1000ms 256MiB

Longest Zero Sequence

Longest Zero Sequence

Given a binary string S consisting only of characters '0' and '1', find the length of the longest contiguous sequence of zeros in the string.

Formally, let \( S = s_1s_2\cdots s_n \) where \( s_i \in \{0,1\} \). You are required to compute \( L \), the maximum length of a substring consisting solely of '0's. For example, if S = "110001110000111", then the longest sequence of consecutive zeros has length 4.

inputFormat

The input consists of a single line containing the binary string S. The string consists only of characters '0' and '1' and its length can be large (up to 106 characters).

outputFormat

Output a single integer which is the length of the longest contiguous sequence of '0's in the given string.

## sample
110001110000111
4