{"raw_statement":[{"iden":"problem statement","content":"A group of people played a game. All players had distinct scores, which are non-negative integers.\nTakahashi knows $N$ facts on the players' scores. The $i$\\-th fact is as follows: the $A_i$\\-th highest score among the players is $B_i$.\nFind the maximum possible number of players in the game."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)$\n*   $0 \\leq B_i \\leq 10^9(1\\leq i\\leq N)$\n*   If $i ≠ j$, $A_i ≠ A_j$.\n*   There exists a possible outcome of the game that are consistent with the facts.\n*   All input values are integers."},{"iden":"inputs","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $B_1$\n:\n$A_N$ $B_N$"},{"iden":"sample input 1","content":"3\n4 7\n2 9\n6 2"},{"iden":"sample output 1","content":"8\n\nThe maximum possible number of players is achieved when, for example, the players have the following scores: $12,9,8,7,5,2,1,0$."},{"iden":"sample input 2","content":"5\n1 10\n3 6\n5 2\n4 4\n2 8"},{"iden":"sample output 2","content":"7"},{"iden":"sample input 3","content":"2\n1 1000000000\n1000000000 1"},{"iden":"sample output 3","content":"1000000001"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}