#include <bits/stdc++.h>
using namespace std;
using ll = long long;

//macros
#define fi first
#define se second
#define pb push_back
#define ReadInputFile() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define FAST_IO() ios_base::sync_with_stdio(false);cin.tie(nullptr);
const int MAX = 1e9+1;
const long long int Pinf = INT_MAX, Ninf = INT_MIN;
const long int mod = 1e9+7;


//debug template
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second);
cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""),
                          __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

int main(){
	ll n; cin >> n;
	vector<pair<ll, ll>> arr(n);
	for(ll i = 0; i < n; i++){
		int x, y;
		cin >> x >> y;
		arr[i] = {x,y};
	}
	debug(arr);
	ll sum = 0;
	for(auto i : arr){
		int a = i.fi, b = i.se;
		ll d = b-a+1;
		sum += (d*b) - (d*(d-1))/2;
	}
	cout << sum << endl;
}















#include<bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)

                    
using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}
int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}
using namespace std;


int main() {
  int N; cin >> N;
  
  ll sum = 0;
  rep(i, N) {
    ll A, B; cin >> A >> B;
    sum += ((A+B)*(B-A+1))/2;
  }
  cout << sum << endl;

}