    //Bismillahir Rahman-ir Rahim
#include<bits/stdc++.h>
#include<cstdio>

#define PI acos(-1)
#define F first
#define S second
#define debug(x)  cout<<'>'<<#x<<":"<<x<<endl
#define tara ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define Y printf("YES\n")
#define N printf("NO\n")
#define ll long long
#define lll __int128
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<long,long>
#define eb emplace_back
#define pb push_back
#define sc scanf
#define pf printf
#define endl '\n'
#define INF 1<<30
#define ll_INF 1LL<<62
#define MODU 998244353
const int M=1e5;

#define on(x) (marked[x/64] & (1<<((x%64)/2)))
#define mark(x)  marked[x/64] |= (1<<((x%64)/2))

using namespace std ;

int marked[M/64 + 2];
void bitsieve(int n) {
  for (int i = 3; i * i < n; i += 2) {
    if (!on(i)) {
      for (int j = i * i; j <= n; j += i + i) {
        mark(j);
      }
    }
  }
}

bool bitisPrime(int num) {
  return num > 1 && (num == 2 || ((num & 1) && !on(num)));
}

bool isPrime(int n)
{
    if (n <= 1)
        return false;

    for (int i = 2; i < n; i++)
        if (n % i == 0)
            return false;

    return true;
}

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

struct node{
    int x, y ;
};


bool cmp(int a, int b ){
    return a>b ;
}

int main(){
    //tara ;
    int n ;
    cin>>n ;
    ll sum=0 ;
    while(n--){
        int a, b ; cin>>a>>b ;
        a-- ;
        ll aa=0,bb=0 ;
        if(a&1){
            aa=(a+1)/2 ;
            aa*=a ;
        }
        else {
            aa=a/2 ;
            aa*=(a+1) ;
        }
         if(b&1){
            bb=(b+1)/2 ;
            bb*=b ;
        }
        else {
            bb=b/2 ;
            bb*=(b+1) ;
        }

        sum+=(bb-aa) ;
    }
    cout<<sum<<endl;
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	long long sum=0;
	for(int i=1;i<=n;i++){
		long long a,b;
		scanf("%lld%lld",&a,&b);
		sum=sum+(a+b)*(b-a+1)/2;
	}
	printf("%lld\n",sum);
} 