Solve the programming task below in a Python markdown code block.
problem

At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pasta and juice minus 50 yen.

Given the price of pasta and juice for a day, create a program to find the minimum price for the set menu for that day.



output

Output the minimum price of the set menu for the day in one line.

Example

Input

800
700
900
198
330


Output

848