Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …
Problems
#864

~/algor $ cat problems/iEAlPMj8EUq8

Crossings of diagonals

Hidden (link only)
Medium 1000 ms 64 MB 58%
Share

All diagonals of a convex -gon are drawn. No three diagonals meet at one point inside the polygon. At how many points inside the polygon do the diagonals cross?

A convex polygon with all its diagonals and the inner points where they cross

Input

One positive integer .

Output

One integer — the number of crossing points.

Note

Examples

Input #1
5
Output #1
5
Input #2
6
Output #2
15

Sign in to submit a solution

Signing up is free and takes a minute.