Competitions

# Sweeping line

# Fill the line

**n** segments are painted on the line. The coordinates of the left and right ends of each segment `l`

and _{i}`r`

are known. Find the length of the colored part of the line._{i}

#### Input

The first line contains the number **n** (**1** ≤ **n** ≤ **15000**), the following **n** lines contains the pair of integers `l`

and _{i}`r`

(_{i}`-10`

≤ ^{9}`l`

≤ _{i}`r`

≤ _{i}`10`

).^{9}

#### Output

Print the length of the colored part of the line.

Input example #1

5 6 8 1 2 0 3 7 9 2 4

Output example #1

7