//d
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n;
ll lmax,lmin=10000,rmax,rmin=10000;
struct ball
{
	ll x,y;
}b[200002];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld%lld",&b[i].x,&b[i].y);
		if(b[i].x>b[i].y) swap(b[i].x,b[i].y);
		if(b[i].x>lmax) lmax=b[i].x;
		if(b[i].x<lmin) lmin=b[i].x;
		if(b[i].y>rmax) rmax=b[i].y;
		if(b[i].y<rmin) rmin=b[i].y;
	}
	ll ans=(lmax-lmin)*(rmax-rmin);
	printf("%lld",ans);
}