#jag2018summerday2e. [jag2018summer_day2_e]Self-contained
[jag2018summer_day2_e]Self-contained
Problem Statement
Ao loves certain sets of non-negative integers.
Let be a set of non-negative integers. Whether she loves or not is determined as follows:
- If is the empty set, she loves .
- If, for any (possibly the same) two elements and in , at least one of and is contained in , she loves .
- If none of the above conditions is satisfied, she does not love .
You are a big fan of Ao, and going to present her a set of non-negative integers. Currently you have a set of non-negative integers. You want to erase (possibly zero) elements from so that she loves the set of remaining integers. You also want to maximize the number of remaining integers. What is the largest number of remaining integers?
Constraints
- is not empty.
- The largest element in is not larger than
Input
Input is given from Standard Input in the following format:
Here, is the string which indicates . For each ( ), 1
if contains and 0
if not. It is guaranteed that is 1
.
Output
Print the largest number of remaining integers.
Sample Input 1
1000001001011
Sample Output 1
3
The set . If you erase and , Ao loves the set of remaining integers: .
Sample Input 2
10110110101
Sample Output 2
4
Sample Input 3
0111
Sample Output 3
0
The set of remaining integers must be empty.