P27206 [AtCoder] Lunch
普及
题目描述

Problem Description

At JOI Pasta Shop, the recommended lunch set menu of pasta and freshly squeezed juice is very popular. When ordering this set menu, you choose one from three types of pasta and one from two types of juice. The price of the set menu is the total price of the chosen pasta and juice minus 50 yen.

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


Input Format

The input consists of 5 lines, each containing a positive integer.

The integer on the 1st line is the price of the 1st pasta.
The integer on the 2nd line is the price of the 2nd pasta.
The integer on the 3rd line is the price of the 3rd pasta.
The integer on the 4th line is the price of the 1st juice.
The integer on the 5th line is the price of the 2nd juice.

In the provided input data, it is guaranteed that all pasta and juice prices are between 100 yen and 2,000 yen.

Output Format

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


Sample Input and Output

Sample Input #1

800
700
900
198
330

Sample Output #1

848

Sample Input #2

1999
1999
100
189
100

Sample Output #2

150

Notes/Hints

Sample Explanation 1

In Sample Input/Output #1, the minimum price of the set menu is 848 yen, which is obtained by choosing the 2nd pasta and the 1st juice: 700 + 198 - 50 = 848.


Sample Explanation 2

In Sample Input/Output #2, the minimum price of the set menu is 150 yen, which is obtained by choosing the 3rd pasta and the 2nd juice: 100 + 100 - 50 = 150.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
800 700 900 198 330
样例输出
848