#include <iostream>

using namespace std;
typedef long long ll;
int main(void) {
  ll N;
  cin >> N;
  ll sum = 0;

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

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n;cin>>n;
  ll r=0;
  rep(i, n){
    ll a,b;cin>>a>>b;
    b = b*(b+1)/2;
    a--;
    a = a*(a+1)/2;
    r += b-a;
  }

  cout<<r<<endl;

  return 0;
}
  