Fill the line
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
segments are painted on the line. The coordinates of the left and right ends of each segment and are known. Find the length of the colored part of the line.
Input
The first line contains the number , the following lines contains the pair of integers and .
Output
Print the length of the colored part of the line.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 28%