#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn=100001;

struct VEC {
	LL x,y;
	bool operator<(const VEC &t) const { return x!=t.x?x<t.x:y<t.y; }
};

int n;
VEC p[maxn];
LL lx,rx,ly,ry;
LL sxl[maxn],sxr[maxn];
LL ans1,ans2;
int main() {
	for (;~scanf("%d",&n);) {
		lx=ly=1e8; rx=ry=1;
		for (int i=1;i<=n;i++) {
			scanf("%lld%lld",&p[i].x,&p[i].y);
			lx=min(lx,p[i].x),ly=min(ly,p[i].y);
			rx=max(rx,p[i].x),ry=max(ry,p[i].y);
		}
		sort(p+1,p+1+n);
		sxl[n]=p[n].y-1; sxr[n]=p[n].y+1;
		for (int i=n-1;i>=1;i--) {
			sxl[i]=min(sxl[i+1],p[i].y-1);
			sxr[i]=max(sxr[i+1],p[i].y+1);
		}

		ans1=2*((rx+1-(lx-1))+(ry+1-(ly-1)));
		ans2=0;

		LL lb=1e8+1,rb=0; LL prelb,prerb;
		bool reachl=0,reachr=0;
		LL prex;
		for (int i=1,j;i<=n;i=j) {
			LL mx=p[i].y+1,ms=p[i].y-1;
			for (j=i+1;j<=n&&p[j].x==p[i].x;j++) {
				mx=max(mx,p[j].y+1);
				ms=min(ms,p[j].y-1);
			}

			if (reachl) lb=max(lb,sxl[i]);
			if (reachr) rb=min(rb,sxr[i]);

			if (i>1) {
				if (p[i].x!=prex+1) {
					if (reachl^reachr) {
						LL ww=(p[i].x-prex-2)*(rb-lb);
						if (lb>=rb) {  //一开始这里的条件按写成了ww<=0。当遇到(p[i].x-prex-2)==0而lb和rb相差很大的时候，它就会出错。
							ans2+=abs(rb-lb)+(p[i].x-prex-2)+1;
						}
						else ans2+=ww;
					}
					else {  //不同方向不会出现线段距离过小的情况
						ans2+=(p[i].x-prex-2)*(rb-lb);
					}
				}
			}

			if (!reachl) lb=min(lb,ms);
			if (!reachr) rb=max(rb,mx);

			ans2+=2*(rb-lb);
			if (p[i].x==prex+1) {
				if (min(prerb,rb)<max(prelb,lb)) {
					ans2+=abs(min(prerb,rb)-max(prelb,lb));
				}
				else {
					ans2-=min(prerb,rb)-max(prelb,lb);  //??
				}
			}

			for (int k=i;k<j;k++) {
				if (p[k].y==ly) reachl=1;
				if (p[k].y==ry) reachr=1;
			}

			prex=p[i].x;
			prelb=lb; prerb=rb;
		}

		printf("%lld %lld\n",ans1,ans2);
	}
	return 0;
}
