Problem Statement
You are given a length string such that is a binary string (all characters are either or ). The string represents some information about the problems on your favourite problem solving site YeetCode.
For some character in there are two cases:
- if then that means the YeetCode problem is a premium problem.
- if then that means the YeetCode problem is not a premium problem (a non-premium problem).
Since you are poor, you do not have access to YeetCode premium, however, the people at YeetCode have coded it so that if you click the button, instead of only getting YeetCode non-premium problems, they put you on any random problem (uniformly distributed). When this happens, if you are on problem , you will click the button and go to the next problem (problem ) until you get to a non-premium problem. If you press the button and you are problem , you will go to problem .
You would like to determine the non-premium problem with which you have the most likelihood of ending on after going through this process. If there are multiple with the same highest probability, then choose the one with the smallest problem number.
Input Format
Your only line of input should contain a string of length representing .
Output Format
Your only line of output should contain the problem you are most likely to end on,
Constraints
- or
- will contain at least one
Sample Cases
Input 1
1110110
Output 1
4
Input 2
1011011
Output 2
2
Input 3
01110001011101000111
Output 3
1
Comments