#P2181. 对角线

对角线

Diagonals

Problem Description

For a convex polygon with nn vertices, no three of its diagonals intersect at a single point. Find the number of intersection points of the diagonals in the figure.

For example, a hexagon (66 vertices):

Input Format

The input is a single line containing one integer nn: the number of sides (vertices).

Output Format

Output one line containing one integer: the answer.

Sample Input 1

3

Sample Output 1

0

Sample Input 2

6

Sample Output 2

15

Hint

Data Scale and Constraints

  • For 50%50\% of the data, 3≤n≤1003 \leq n \leq 100 is guaranteed.
  • For 100%100\% of the data, 3≤n≤1053 \leq n \leq 10^5 is guaranteed.