In a convex -gon, all diagonals are drawn so that no three of them intersect at a single point. How many different triangles are formed?

Each line is a separate test and contains a positive integer (2 < n \leq 1000).
For each test, output on a separate line the number of different triangles formed after all diagonals are drawn.
Example 1