Pedestrian Zones vs. Roundabouts
In the city of S., road improvements have been neglected for a long time. Finally, the mayor has decided to tackle the traffic congestion by converting all roads into one-way streets. Additionally, the entire city will be encircled by ring roads. A one-way road is considered part of a ring if you can travel from its endpoint back to its start by following the city's roads in the allowed directions. Roads that cannot be included in any ring will be converted into pedestrian zones. Your task is to calculate the total length of these pedestrian zones after the reform. The roads are represented as segments on a plane, which may overlap. Overlapping segments do not imply parallel roads "next to" each other; they simply indicate that a portion of the road is represented in multiple segments on the plane.
Input
The first line of the input contains an integer n (1 ≤ n ≤ 40), representing the number of roads in the city. The following n lines describe the segments with pairs of coordinates for their endpoints. All segments have a positive length, and the coordinates do not exceed 100 in absolute value.
Output
Output the total length of all pedestrian zones after the reform. The result should be displayed with a precision of 5 decimal places.