#C9382. Minimum Chocolate Bar Breaks

    ID: 53469 Type: Default 1000ms 256MiB

Minimum Chocolate Bar Breaks

Minimum Chocolate Bar Breaks

Given a chocolate bar of dimensions n by m, your task is to determine the minimum number of breaks required to split the bar into individual 1×1 pieces. With each break, you can split one piece of chocolate into two parts. The optimal strategy yields a result that can be directly computed using the formula:

$$ n \times m - 1 $$

For example, if you have a 2×2 chocolate bar, you need 3 breaks to separate it into 4 individual pieces.

inputFormat

The input consists of two integers n and m (separated by a space) representing the number of rows and columns of the chocolate bar.

outputFormat

Output a single integer, the minimum number of breaks required to split the chocolate bar into 1×1 pieces.

## sample
2 2
3