Joisino is working as a receptionist at a theater.

The theater has 100000 seats, numbered from 1 to 100000.

According to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).

How many people are sitting at the theater now?

Constraints

* 1≤N≤1000
* 1≤l_i≤r_i≤100000
* No seat is occupied by more than one person.
* All input values are integers.

Input

Input is given from Standard Input in the following format:


N
l_1 r_1
:
l_N r_N


Output

Print the number of people sitting at the theater.

Examples

Input

1
24 30


Output

7


Input

2
6 8
3 3


Output

4
/* Filename: ABC073B.java
 * Author: Mushiyo
 */

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		
		while(input.hasNext()){
			int total = 0;
			int N = input.nextInt();
			
			while(N > 0){
				int l = input.nextInt();
				int r = input.nextInt();
				
				total += r - l + 1;
				
				--N;
			}
			
			System.out.println(total);
		}
	}

}
