#include <bits/stdc++.h>
using namespace std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define mod       1000000007
#define double    long double
#define ull       unsigned long long
#define vi        vector<ll>
#define ppi       pair<int,int>
#define pii       pair<int,pair<int,int>>
#define pb        push_back
#define pi        2*acos(0.0)
#define rev       greater<int>()
#define pr(a,x,y) for(int i=x;i<y;i++){cout<<a[i]<<" ";}
#define ps(s)     for(auto i:s){cout<<i<<"";}
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define rall(v)   v.rbegin(), v.rend()
#define test      cout<<"This is test"<<endl;
#define str       string
#define endl      '\n'
#define e         cout<<'\n';
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
ll get(ll n){
	return (n*(n+1))/2;
}
void solve(){
	ll n;cin>>n;
	ll ans=0;
	while(n--){
		ll x,y;cin>>x>>y;
		ans+=(get(y)-get(x-1));
	}
	cout<<ans;
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	for(int k=1;k<=t;k++){
		//cout<<"Case #"<<k<<": ";
		solve();
		//e;
	}
}
#include <iostream>
using namespace std;
typedef long long ll;

int main(void) {
	ll n, ans = 0;
	ll A, B;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> A >> B;
		ans += B * (B + 1) / 2 - (A - 1) * A / 2;
	}

	cout << ans << endl;

	return 0;
}