Problem list
Log in
#coci00010 · COCI 2006/2007 Contest 2

Sjecišta

Silver V 0.6 s 32 MB

Consider a convex polygon with $N$ vertices, with the additional property that no three diagonals intersect in a single point. Find the number of intersections between pairs of diagonals in such a polygon.

The figure below shows one such polygon with $6$ vertices.

convex hexagon with all diagonals drawn

Note: a polygon is convex if all of its interior angles are less than $180$ degrees.

Input

The first and only line of input contains a single integer $N$ ($3 \le N \le 100$).

Output

Output the number of intersections on a single line.

Example 1

Input
3
Output
0

Example 2

Input
4
Output
1

Example 3

Input
6
Output
15
Source
COCI 2006/2007 Contest 2
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 1 Acceptance 100% Solvers 1

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code