Pedestrian Zones vs. Ring Roads#2094

Pedestrian Zones vs. Ring Roads

1 second
64 megabytes
Medium

In the city of S., road reforms have not been carried out for a long time. The city's mayor finally decided to address traffic congestion by making all roads one-way. To achieve this, the entire city will be covered with ring roads. A road is considered part of a ring if it is possible to return from its endpoint to its starting point by moving along the city's roads in permitted directions. Some roads cannot be made part of any ring; these roads will be turned into pedestrian zones. Calculate the total length of these pedestrian zones after the reform. The roads are given as segments on a plane, which may overlap. An overlapping part between two or more roads does not imply the existence of parallel roads "next to" each other; it simply means the same part is represented in different segments on the plane.

Input

The first line of input contains an integer (1 \le n \le 40), where is the number of roads in the city. Each of the next lines contains the coordinates of the endpoints of a segment. All segments have a positive length. The coordinates do not exceed in absolute value.

Output

Output the total length of all pedestrian zones after the reform. The answer should be shown with a precision of decimal places.

Examples

Example 1

Loading
Loading