#K77982. Number of Diagonals in a Regular Polygon

    ID: 34985 Type: Default 1000ms 256MiB

Number of Diagonals in a Regular Polygon

Number of Diagonals in a Regular Polygon

Given a regular polygon with n vertices, a diagonal is a line segment connecting two vertices that are not adjacent. The task is to compute the number of distinct diagonals in the polygon.

The formula to compute the number of diagonals is given by:

n(n3)2\frac{n(n-3)}{2}

For example, a triangle (n = 3) has 0 diagonals, a quadrilateral (n = 4) has 2 diagonals, and a pentagon (n = 5) has 5 diagonals.

inputFormat

The input consists of a single integer n (n ≥ 3) representing the number of vertices of the regular polygon. The input is provided via standard input.

outputFormat

Output a single integer that is the number of distinct diagonals in the polygon. The output should be sent to standard output.

## sample
3
0