#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Rar the cat has a large ice cube of dimensions **H** by **W** by **D** cm^{3}. 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** cm^{3}).

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** ≤ 10^{6}

## 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

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 33 | 5 | 1s | 256MB | Minimum |

2 | 40 | 20 | 1s | 256MB | Minimum |

3 | 27 | 20 | 1s | 256MB | Minimum |

4 | 0 | 3 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-7 ans.cpp -o cubecutting -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512