n segments are painted on the line. The coordinates of the left and right ends of each segment li and ri are known. Find the length of the colored part of the line.
The first line contains the number n (1≤n≤15000), the following n lines contains the pair of integers li and ri (−109≤li≤ri≤109).
Print the length of the colored part of the line.