Fill the line#1070

Fill the line

1 second
128 megabytes
Very easy

segments are colored on the number line. The coordinates of the left and right endpoints of each segment, l_i and r_i, are given. Find the total length of the colored part of the number line.

Input

The first line contains the integer (1 \le n \le 15000). The next lines contain two integers l_i and r_i (-10^9 \le l_i \le r_i \le 10^9) — the coordinates of the endpoints of the segments.

Output

Print the total length of the colored part of the number line.

Examples

Example 1

Loading
Loading