Problem A
Building Fences

Donald is a fence builder. He wants to build a fence that is
How many cuts does Donald have to make to get the fence posts for his fence?
Input
The first line has two space-separated integers,
Output
Output the minimum number of cuts needed to build the fence.
Limits
Sample Input 1 | Sample Output 1 |
---|---|
1 2 3 |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
2 5 4 2 |
4 |