Maximum Difference Of Zeros And Ones In Binary String

easy
1. You are given a string containing only 0's and 1's.
2. You have to find the length of substring which is having maximum difference of number of 0s and number of 1s i.e (Number of 0's - Number of 1's).
3. If there are all 1's present in the given string, then print '-1'. 

Input Format

A Binary String

Output Format

A number

Constraints

1 <= length of string <= 10^5

Example

Input
11000010001
Output
6
Previous
Distinct Transformations
Next
Number Of Paths Along The Edges In Upper Half Of A Square Matrix

Related Questions