#include<map>
#include<cmath>
#include<list>
#include<queue>
#include<bitset>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define ll long long
#define lbw 1000000009
#define inf 2147483647
using namespace std;
ll read(){ll ans=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')ans=ans*10+c-'0',c=getchar();return ans*f;}
ll n,m,v[100005],first[100005],cnt,fa[100005],root=1,dp[100005][2],x,y,z,now,now_val;
struct edge{
	ll to,nxt;
}e[200005];
void add(ll x,ll y){
	e[++cnt].nxt=first[x];
	e[cnt].to=y;
	first[x]=cnt;
}
void dfs(ll now,ll f){
	dp[now][1]=1;
	for(int i=first[now],v;i;i=e[i].nxt){
		v=e[i].to;
		if(v==f)continue;
		dfs(v,now);
		dp[now][0]+=dp[v][1];
		dp[now][1]+=min(dp[v][1],dp[v][0]);
	}
}
ll sum(ll n){
	return n*(n+1)/2;
}
int main(){
	n=read();ll ans=0;
	for(int i=1;i<=n;i++){
		ll l=read(),r=read();
		ans+=sum(r)-sum(l-1);
	}
	cout<<ans;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(ll i=0;i<(ll)n;++i)

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