#K78437. Maximum Difference in Coin Distribution
Maximum Difference in Coin Distribution
Maximum Difference in Coin Distribution
Alex has n coins and wants to distribute them between two players, Ben and Chris. Each player must receive at least one coin. The goal is to determine the maximum possible absolute difference between the number of coins Ben and Chris can receive. One way to achieve this is to give one of the players 1 coin and the other player n - 1 coins, which yields an absolute difference of:
$$|1 - (n-1)| = n - 2$$
This formula holds for any n satisfying $$2 \leq n \leq 10^9$$.
inputFormat
The input consists of a single integer n provided via standard input. It represents the total number of coins Alex has, and it satisfies the condition $$2 \leq n \leq 10^9$$.
Input format: A single line containing the integer n.
outputFormat
The output should be a single integer printed to standard output, representing the maximum possible absolute difference between the coins received by Ben and Chris.
Output format: A single integer value.
## sample2
0