{"raw_statement":[{"iden":"problem statement","content":"Team Takahashi and Team Aoki are playing a baseball game, with Team Takahashi batting first.  \nCurrently, the game has finished through the top of the ninth inning, and the bottom of the ninth is about to begin.\nTeam Takahashi scored $A_i$ runs in the top of the $i$\\-th inning $(1\\leq i\\leq 9)$, and Team Aoki scored $B_j$ runs in the bottom of the $j$\\-th inning $(1\\leq j\\leq 8)$.  \nAt the end of the top of the ninth, Team Takahashi's score is not less than Team Aoki's score.  \nDetermine the minimum number of runs Team Aoki needs to score in the bottom of the ninth to win the game.\nHere, if the game is tied at the end of the bottom of the ninth, it results in a draw. Therefore, for Team Aoki to win, they must score strictly more runs than Team Takahashi by the end of the bottom of the ninth.  \nTeam Takahashi's score at any point is the total runs scored in the tops of the innings up to that point, and Team Aoki's score is the total runs scored in the bottoms of the innings."},{"iden":"constraints","content":"*   $0\\leq A_i, B_j\\leq 99$\n*   $A_1 + A_2 + A_3 + A_4 + A_5 + A_6 + A_7 + A_8 + A_9 \\geq B_1 + B_2 + B_3 + B_4 + B_5 + B_6 + B_7 + B_8$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$A_1$ $A_2$ $A_3$ $A_4$ $A_5$ $A_6$ $A_7$ $A_8$ $A_9$\n$B_1$ $B_2$ $B_3$ $B_4$ $B_5$ $B_6$ $B_7$ $B_8$"},{"iden":"sample input 1","content":"0 1 0 1 2 2 0 0 1\n1 1 0 0 0 0 1 0"},{"iden":"sample output 1","content":"5\n\nAt the end of the top of the ninth inning, Team Takahashi has scored seven runs, and Team Aoki has scored three runs.  \nTherefore, if Team Aoki scores five runs in the bottom of the ninth, the scores will be $7-8$, allowing them to win.  \nNote that scoring four runs would result in a draw and not a victory."},{"iden":"sample input 2","content":"0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0"},{"iden":"sample output 2","content":"1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}