Area Folding#5837

Area Folding

1 second
64 megabytes
Medium

You are given one polygonal line, which is a collection of line segments. Your task is to calculate the sum of areas enclosed by the polygonal line.

A point is defined to be "enclosed" if and only if the point is unreachable without crossing at least one line segment from the point at infinity.

Input

The first line contains one integer (2 \leq N \leq 100). is the number of segments.

Each of the following lines consists of two integers X_i and Y_i (-10^5 \leq X_i, Y_i \leq 10^5, 1 \leq i \leq N) which represents a vertex. A polygonal line is the segments which connect (X_j, Y_j) and (X_{j+1}, Y_{j+1}) ((X_j, Y_j) \neq (X_{j+1}, Y_{j+1}), 1 \leq j \leq N-1). The distance between a segment S_j and all vertices except the end points on segment S_j is guaranteed to be greater than .

Output

Output the answer in a line. The answer may be printed with an arbitrary number of decimal digits, but may not contain an absolute or relative error greater than or equal to 10^{-6}.

Examples

Example 1

Loading
Loading