Problem Description
Rar the cat has a large ice cube of dimensions H by W by D cm3. It is very inconvenient to carry a large cube. Hence, Rar the Cat would like to cut the large ice cube into H * W * D ice cubes of unit dimensions (1 by 1 by 1 cm3).
However, Rar the Cat wants to know that is the minimum number of cuts required to cut up the large ice cube into ice cubes of unit dimensions. Each cut is defined as taking a piece of ice cube of any size and cutting it into 2 ice cubes of any size. The cuts can be in any direction you wish but only 1 ice cube can be cut at a time.
Input
The first line of input will contain 3 integers, H followed by W and then D.
Output
Output a single integer, the minimum number of cuts required to cut up the large ice cube.
Limits
Subtask 1 (33%): 1 ≤ H ≤ 1000, W = 1, D = 1
Subtask 2 (40%): 1 ≤ H, W, D ≤ 1000
Subtask 3 (27%): 1 ≤ H, W, D ≤ 106
Sample Testcase 1
Input
1 1 1
Output
0
Sample Testcase 2
Input
1 2 2
Output
3
Sample Testcase 3
Input
10 1 1
Output
9