#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using ull=unsigned long long;
const ll LL_MAX=LLONG_MAX;

struct In{
    template<typename T>
    operator T(){
        T x;
        cin >> x;
        return x;
    }
};
In in;

template <typename T,typename U>
void forin(T* x,U n){
    for (U i=0;i<n;i++) cin >> x[i];
}

template <typename T>
int div1(T x) {
    return x%1000000007;
}

template <typename T>
void out(T x){
    cout << x << endl;
}

template <typename T>
T gcd(T x,T y){
    if (y == 0) return x;
    return gcd(y,x%y);
}

template <typename T>
T lcm(T x,T y){
    return x*y/gcd(x,y);
}

int main(){
    ull n=in,a,b;
    ull ans=0;
    for (int i=0;i<n;i++){
        a=in,b=in;
        ans+=(b*b+b-a*a+a)/2;
    }
    out(ans);
}

#include <bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(0), cin.tie(NULL)
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
#define mkp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long  ull;

constexpr int INF = INT_MAX;

using namespace std;

int main(){
    fastIO;
    int N;
    cin >> N;
    ll sum = 0;
    while (N--)
    {
        ll a, b;
        cin >> a >> b;
        sum += ((b * (b + 1)) / 2) - ((a * (a + 1)) / 2) + a;
    }
    cout << sum;
    return 0;
}