Chocolate bar#1787

Chocolate bar

1 second
64 megabytes
Hard

Roma is playing an interesting game by himself. The game uses a box of chocolates arranged in a grid of n \times m pieces. The chocolates are either dark or white. Initially, the box is filled randomly with these chocolates. Then, Roma repeatedly performs the following operation: he finds three adjacent chocolates of the same color, lying either in a straight line or forming an "L" shape, eats them, and fills the empty positions with new chocolates at random. If there are no three adjacent chocolates of the same color, the game ends.

Count how many distinct configurations may remain on the board (i.e., in the box) when the game is over. For example, if n = 2, m = 3, there are eight different possible final configurations:

(In these configurations, "B" and "W" represent dark and white chocolate, respectively.)

Input

The input contains two integers and (1 \leq n, m \leq 1000).

Output

Output a single integer — the answer to the problem.

Examples

Example 1

Loading
Loading