#abc139d. [abc139_d]ModSum
[abc139_d]ModSum
Problem Statement
For an integer , we will choose a permutation of .
Then, for each , let be the remainder when is divided by .
Find the maximum possible value of .
Constraints
- is an integer satisfying .
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible value of .
Sample Input 1
2
Sample Output 1
1
When the permutation is chosen, .
Sample Input 2
13
Sample Output 2
78
Sample Input 3
1
Sample Output 3
0