Croatian cube
The image depicts a standard die with numbers from 1 to 6 on its faces.
In the image, three faces of the die are visible, while the hidden faces have the numbers 4, 5, and 6, arranged such that the sum of the numbers on opposite faces equals 7. Specifically, 6 is opposite 1, 5 is opposite 2, and 4 is opposite 3.
Petya places the die in the top-left cell of a table with R rows and C columns. Initially, the die is oriented so that the top face shows the number 1, and the face with the number 3 is facing to the right. Petya then performs the following actions:
He rolls the die from face to face across the cells of the table to the right until he reaches the last column.
Then he rolls the die down to the next row.
Next, he rolls the die to the left until he reaches the first column.
As in step 2, he rolls the die down to the next row.
Petya repeats these steps as long as possible, meaning until he can no longer roll the die down to the next row. Each time the die lands on a cell of the table, Petya records the number on the top face of the die. At the end, he sums all the recorded numbers.
Help Petya verify if he calculated the sum correctly.
Input
The first and only line of the input file contains two positive integers R and C (1 ≤ R, C ≤ 100000) - the dimensions of the table.
Output
The output file should contain a single number - the sum obtained according to the rules described in the problem statement.