Intervals
On the real line, there are n intervals, each with endpoints at integer positions. These endpoints are not included in the intervals themselves. You are given information about which intervals intersect with each other. Using this information, your task is to determine the minimum possible total length of all intervals. Note that each interval must have a length of at least 1.
Input
The first line of input provides two integers: n, the number of intervals, and m, the number of intersecting pairs of intervals. The following m lines list pairs of intervals that intersect. Intervals are numbered from 0 to n-1. If a pair is not listed, the intervals do not intersect. It is guaranteed that it is possible to construct a set of intervals that matches the given intersection information.
Constraints
1 ≤ n ≤ 1234
0 ≤ m ≤ n(n-1)/2
Output
Output the minimum possible total length of all intervals, ensuring that no interval has zero length.