ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

Ural Regional School Programming Contest 2015

About     Problems     Submit solution     Judge status     Standings
Contest is over

E. Simple Expression

Time limit: 1.0 second
Memory limit: 64 MB
You probably know that Alex is a very serious mathematician and he likes to solve serious problems. This is another problem from Alex.
You are given three nonnegative integers a, b, c. You have to arrange them in some order and put +, − or × signs between them to minimize the outcome of the resulting expression. You are not allowed to use unary minus and parentheses in the expression. There must be exactly one sign between every pair of neighbouring numbers. You should use standard order for performing operations (multiplication first, addition and subtraction then).

Input

There are three lines with one integer in each line. The numbers are arranged in non-decreasing order (0 ≤ abc ≤ 100).

Output

Print one number — the minimal outcome.

Sample

inputoutput
1
2
3
-5
Problem Author: Kirill Borozdin
Problem Source: Ural Regional School Programming Contest 2015
To submit the solution for this problem go to the Problem set: 2066. Simple Expression