Winnie has become the best person on earth in chess, however she wants to be the best chess player in the universe. Winnie has decided to create a spaceship and participate in an intergalactic chess tournament. She is participating in a tournament with
Input Specification
The first line of input will contain
The next line of input will contain 1
or 0
. 1
indicates that Winnie can always beat the 0
indicates that Winnie will always lose against the
The next line of input will contain
If Winnie is very unlucky, her rating can be negative during and after the tournament.
Output Specification
Output Winnie's rating after the tournament.
Constraints
Sample Input 1
3 3 3 3 4
1 0 1
3 2 2 1
Sample Output 1
3
Explanation 1
Winnie will win against players 1 and 3, but will lose against player 2 twice. Since she gains the same rating for winning as for losing, her rating will not change and stay at 3.
Comments