Area Folding
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 integers N (2 ≤ N ≤ 100). N is the number of segments.
Each of the following N lines consists of two integers X_{i }and Y_i (-10^5 ≤ X_i, Y_i ≤ 10^5, 1 ≤ i ≤ 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) ≠ (X_{j+1}, Y_{j+1}), 1 ≤ j ≤ 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 0.01.
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}.