#include<bits/stdc++.h>
using namespace std;
//typedef
typedef long long ll;
typedef pair<ll,ll> PLL;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<bool> VB;
typedef vector<VB> VVB;
typedef vector<string> VS;
//template
template<class T> inline bool chmin(T &a, T b) {if (a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) {if (a < b){a = b; return true;} return false;}
//repetition
#define FOR(i,a,b) for(int i=int(a); i<int(b); ++i)
#define FORD(i,a,b) for(int i=int(a); i<int(b); --i)
#define REP(i,N) for(int i=0; i<int(N); ++i)
#define REPS(i,N) for(int i=0; i<=int(N); ++i)
#define REPD(i,N) for(int i=0; i<int(N); --i)
//container util
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//constant
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7
#define MAXR 100000 //配列の最大のrenge
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
    ll N; cin >> N;
    ll ans=0;

    REP(i,N) {
        ll tmp_1,tmp_2; cin>>tmp_1>>tmp_2;
        if ((tmp_2-tmp_1)%2==0) ans += ((tmp_1 + tmp_2) * ((tmp_2 - tmp_1)/2) + (tmp_2+tmp_1)/2);
        else ans += ((tmp_1 + tmp_2) * ((tmp_2 - tmp_1 + 1)/2));
    }
    
    cout << ans << endl;
}
#include <bits/stdc++.h>
#define ll unsigned long long
#define pi 3.141592653
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define F first
#define S second
#define MAX 100005
using namespace std;
ll count(ll n)
{
    ll c=0;
    while(n!=0)
    {
        
        c++;
        n=n/10;
    }
    
    return c;
}
int isPrime(ll n) 
{ 
    // Corner case 
    if (n <= 1) 
        return 0; 
  
    // Check from 2 to n-1 
    for (ll i = 2; i < n; i++) 
        if (n % i == 0) 
            return 0; 
  
    return 1; 
} 
ll modFact(ll n, ll p) 
{ 
    if (n >= p) 
        return 0; 
  
    ll result = 1; 
    for (ll i = 1; i <= n; i++) 
        result = (result * i) % p; 
  
    return result; 
} 
ll divisor(ll n)
{   ll h=1;
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            h=i;
            break;
        }
    }
    return h;
}
bool sortbysec(const pair<ll,ll> &a, 
              const pair<ll,ll> &b) 
{ 
    return (a.second < b.second); 
} 
 const int logN = 20;
int f[MAX][logN],mval[MAX][logN],depth[MAX];
vector<pair<int,int> >v[100005];
void dfs(int u)
{
	for(int i=1;i<logN;i++)
	{
		f[u][i]=f[f[u][i-1]][i-1];
		mval[u][i]=max(mval[u][i-1],mval[f[u][i-1]][i-1]);
	}
	for(auto i:v[u])
	{
		int ver=i.first,w=i.second;
		if(!depth[ver])
		{
			f[ver][0]=u;
			mval[ver][0]=w;
			depth[ver]=depth[u]+1;
			dfs(ver);
		}
	}
}
ll sum(ll x)
{
   ll s = 0;
   while (x != 0) {
      s = s + x % 10;
      x = x / 10;
   }
  return s;
}


ll fact(ll n); 

ll nCr(ll n, ll r) 
{ 
	return fact(n) / (fact(r) * fact(n - r)); 
} 

// Returns factorial of n 
ll fact(ll n) 
{ 
	int res = 1; 
	for (int i = 2; i <= n; i++) 
		res = res * i; 
	return res; 
} 
ll modularExponentiation(ll x,ll n,ll M)
{
 if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return modularExponentiation((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*modularExponentiation((x*x)%M,(n-1)/2,M))%M;
}
ll xorOfArray(ll arr[], ll n) 
{ 
    // Resultant variable 
    ll xor_arr = 0; 
  
    // Iterating through every element in 
    // the array 
    for (ll i = 1; i <=n; i++) { 
  
        // Find XOR with the result 
        xor_arr = xor_arr ^ arr[i]; 
    } 
  
    // Return the XOR 
    return xor_arr; 
} 

// Returns (a * b) % mod 
ll moduloMultiplication(ll a, 
							ll b, 
							ll mod) 
{ 
	ll res = 0; // Initialize result 

	// Update a if it is more than 
	// or equal to mod 
	a %= mod; 

	while (b) 
	{ 
		// If b is odd, add a with result 
		if (b & 1) 
			res = (res + a) % mod; 

		// Here we assume that doing 2*a 
		// doesn't cause overflow 
		a = (2 * a) % mod; 

		b >>= 1; // b = b / 2 
	} 

	return res; 
} 



int main()
{ 
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
ll m=998244353;
ll a,b,c;
cin>>a>>b>>c;
ll x=a*(a+1)/2;//moduloMultiplication(a,a+1,998244353);
ll y=b*(b+1)/2;//moduloMultiplication(b,b+1,998244353);
ll z=c*(c+1)/2;//moduloMultiplication(c,c+1,998244353);

ll s=moduloMultiplication(x,y,998244353);
ll ans=moduloMultiplication(s,z,998244353);
cout<<ans;
    return 0;
}