#include<bits/stdc++.h>
using namespace std;
const int N=200010;
int w1[N],w2[N]; 
int main()
{
	int n;
	scanf("%d",&n);
	int a,b;
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a,&b);
		if(a>b)swap(a,b);
		w1[i]=a;w2[i]=b;
	}
	int maxn=0,minn=1e9;
	for(int i=1;i<=n;i++){
		if(maxn<w1[i])maxn=w1[i];
		if(minn>w1[i])minn=w1[1];
	}
	long long p=maxn-minn;
	maxn=0;minn=1e9;
	for(int i=1;i<=n;i++){
		if(maxn<w2[i])maxn=w2[i];
		if(minn>w2[i])minn=w2[1];
	}
	long long q=maxn-minn;
	printf("%lld\n",p*q);
	return 0;
}
