This page is still under construction.

Parts of this page are still being built. What you see may change.

Sanggeunald

Time limit1sMemory limit128 MB

Summary
Given prices for three burgers and two drinks, print the lowest cost of one burger plus one drink minus a 50 won combo discount.
Level

Easy1 of 10

Topics
Implementation, Math, Brute force, Array
Solved
No attempts yet

Problem

The best-selling item at Sanggeunald is the combo meal. When ordering, you choose one hamburger and one drink and buy them together as a combo; the combo's price is the sum of the two prices minus 50 won.

There are three hamburgers — the Sangdeok Burger, the Jungdeok Burger, and the Hadeok Burger — and two drinks, cola and cider.

Given the price of each hamburger and each drink, write a program that prints the price of the cheapest possible combo meal.

Input

The input consists of five lines. The first line gives the price of the Sangdeok Burger, the second line the price of the Jungdeok Burger, and the third line the price of the Hadeok Burger. The fourth line gives the price of the cola, and the fifth line the price of the cider. Every price is between 100 and 2000 won, inclusive.

Output

Print the price of the cheapest combo meal on the first line.

Examples2

  1. Example 1

    Input
    800
    700
    900
    198
    330
    
    Expected output
    848
    
  2. Example 2

    Input
    1999
    1999
    100
    189
    100
    
    Expected output
    150