ACM ICPC Gwalior Round Problem B

The problem is as follows:

There are N points on a circle. All the points are joined such that no three lines are intersecting at the same point. We need to find the maximum number of regions thus formed.

I asked the problem setter. He told me that I need to use Euler Formula to solve this question. Could anyone provide an insight how to go about solving this question.

Here is the link of the actual question:
link

Input:

2

3

4

5

Output:

2

4

8

16