When Homework Feels Impossible

Time limit1sMemory limit128 MB

Problem

Sanggeun does not want to do his homework, so he decides to play a game with Changyoung and wager one month of homework. The loser must do both people's homework for a month. Sanggeun chooses a game he played as a child, and Changyoung accepts.

The game uses a die shaped as shown below.

The numbers on opposite faces always sum to 7. Thus 1 is opposite 6, 2 is opposite 5, and 3 is opposite 4. In the shown orientation, the initial top face is 1, the right face is 3, and the front face is 2.

Draw a grid whose cells have the same size as one face of the die. The grid has R rows and C columns. The die starts on the upper-left cell. Then roll the die as follows.

  1. Roll it to the right until it reaches the last column.
  2. Roll it one cell down to the next row.
  3. Roll it to the left until it reaches the first column.
  4. Roll it one cell down again.

Repeat this process while it is possible to move down, ending on the last row. Whenever the die is placed on a cell, Changyoung writes down the number on its top face. The top face on the starting cell is included. At the end, Changyoung sums all written numbers and asks Sanggeun for the answer.

Given R and C, write a program that computes the sum of the top-face numbers Changyoung writes down.

Input

The first line contains R and C. (1 <= R, C <= 100,000)

Output

Print the sum of the top-face numbers.