{"raw_statement":[{"iden":"problem statement","content":"You planned a trip using trains and buses. The train fare will be $A$ yen (the currency of Japan) if you buy ordinary tickets along the way, and $B$ yen if you buy an unlimited ticket. Similarly, the bus fare will be $C$ yen if you buy ordinary tickets along the way, and $D$ yen if you buy an unlimited ticket.\nFind the minimum total fare when the optimal choices are made for trains and buses."},{"iden":"constraints","content":"*   $1 \\leq A \\leq 1$ $000$\n*   $1 \\leq B \\leq 1$ $000$\n*   $1 \\leq C \\leq 1$ $000$\n*   $1 \\leq D \\leq 1$ $000$\n*   All input values are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$A$\n$B$\n$C$\n$D$"},{"iden":"sample input 1","content":"600\n300\n220\n420"},{"iden":"sample output 1","content":"520\n\nThe train fare will be $600$ yen if you buy ordinary tickets, and $300$ yen if you buy an unlimited ticket. Thus, the optimal choice for trains is to buy an unlimited ticket for $300$ yen. On the other hand, the optimal choice for buses is to buy ordinary tickets for $220$ yen.\nTherefore, the minimum total fare is $300 + 220 = 520$ yen."},{"iden":"sample input 2","content":"555\n555\n400\n200"},{"iden":"sample output 2","content":"755"},{"iden":"sample input 3","content":"549\n817\n715\n603"},{"iden":"sample output 3","content":"1152"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}