A highway is marked with integer mileposts. There are n inspection ranges, each a closed range [start, end] covering every integer milepost x with start <= x <= end (a range with start == end covers exactly one milepost). Count the number of distinct integer mileposts covered by at least one range. Note that two ranges like [1,3] and [4,6] cover disjoint integer mileposts even though no gap exists between the integers 3 and 4.
Input format
Line 1: an integer n.
Next n lines: two integers start and end describing one range.
Output format
A single integer: the count of distinct covered integer mileposts.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ start ≤ end ≤ 1000000000