Problems
365 - King in Chessboard
SUBMIT PROBLEM

King in Chessboard

Time Limit: 1 sec

 

The Problem

In a chessboard a king can move only one cell of its left, right, up, down and diagonally from its position. That’s position is the attacking position of a king. Generally we play chess in an 8*8 chessboard. It means that there are 8 rows and 8 columns. Now given an N*M chessboard, you have to find out maximum number of king that can take place in an N*M chessboard, so that they are not attack one another.

 

 

The Input

There are several lines of input. Each lines contains two integer N and M (0<N, M<=10000). Input is terminated by EOF.

 

The Output

For each input line produce only one integer which is the maximum number of king in the given chessboard.

 

Sample Input

5 6

5 7

 

Sample Output

9

12

 

 

 

 

Problem Setter: Milton Deb