A. Borg Cube
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

The Enterprise has finally found the Borg Cube, and now Picard must get inside. It is clear that the Borg have protected their Cube with a special code. Previously, the code could be easily calculated by reading the numbers in space located at the corners of the cube, but the Borg have covered these numbers with a protective field. The code itself is the sum of all eight numbers hidden at the corners of the Cube.

But now they are not visible...

However, since the Borg had to return to the Cube themselves, and not all of them remembered the code, a hint was left — the numbers on the sides of the Cube. Each corner number can be calculated by multiplying the three numbers on the faces that converge at that corner.

The Enterprise has flown around the Borg Cube — now Picard has the numbers from all sides of the Cube.

Help Picard: knowing the numbers on the sides of the Cube, calculate the sum of all the corner numbers.

Input

The first line contains 6 integers separated by spaces $$$v_1, \ldots, v_6$$$ $$$(1 \le v_i \le 500)$$$ — the numbers located on the top, bottom, left, right, front, and back sides of the Cube, respectively.

Output

In the first line, output a single integer $$$C$$$ $$$(1 \le C \le 10^9)$$$ — the code to access the Borg Cube.

Example
Input
1 2 3 4 4 5
Output
189
Note

First test example

The numbers at the corners of the cube are respectively:

  • top left front corner: $$$v_1 \cdot v_3 \cdot v_5 = 1 \cdot 3 \cdot 4 = 12$$$;
  • top left back corner: $$$v_1 \cdot v_3 \cdot v_6 = 1 \cdot 3 \cdot 5 = 15$$$;
  • top right front corner: $$$v_1 \cdot v_4 \cdot v_5 = 1 \cdot 4 \cdot 4 = 16$$$;
  • top right back corner: $$$v_1 \cdot v_4 \cdot v_6 = 1 \cdot 4 \cdot 5 = 20$$$;
  • bottom left front corner: $$$v_2 \cdot v_3 \cdot v_5 = 2 \cdot 3 \cdot 4 = 24$$$;
  • bottom left back corner: $$$v_2 \cdot v_3 \cdot v_6 = 2 \cdot 3 \cdot 5 = 30$$$;
  • bottom right front corner: $$$v_2 \cdot v_4 \cdot v_5 = 2 \cdot 4 \cdot 4 = 32$$$;
  • bottom right back corner: $$$v_2 \cdot v_4 \cdot v_6 = 2 \cdot 4 \cdot 5 = 40$$$.

The sum of all the corner numbers is $$$12 + 15 + 16 + 20 + 24 + 30 + 32 + 40 = 189$$$.