#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<algorithm>
//#include<ctime>
//#include<cmath>
#include<queue>
#include<set>
#include<map>

using namespace std;
#define LL long long

inline LL read(){
	LL x=0,f=1; char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*f;
}
const LL INF = 2147483600;
const LL MAXN = 100010;

LL N;
struct data{
	LL x,y,id;
}p[MAXN+1];
struct node{
	LL v,id;
	bool operator < (const node &a) const{
		return v<a.v;
	}
}; LL ers[MAXN+1];
vector<LL> vex[MAXN+1];
vector<LL> vey[MAXN+1];
LL X[MAXN+1],Y[MAXN+1];
LL A,B,K;
node nodde(LL vv,LL idd){
	node n; n.v=vv; n.id=idd; return n;
}

inline LL dist(LL i,LL j){
	return max(abs(p[i].x-p[j].x),abs(p[i].y-p[j].y));
}
bool cmpv(node a,node b){
	return a.v<b.v;
}
bool cmpid(data a,data b){
	return a.id<b.id;
}
LL cntx,cnty;
inline LL QueryX(LL x,LL y1,LL y2){
	LL l=lower_bound(vex[x].begin(),vex[x].end(),y1)-vex[x].begin();
	LL r=lower_bound(vex[x].begin(),vex[x].end(),y2+1)-vex[x].begin();
	//cout<<"ret1:"<<r-l<<" "<<x<<" "<<y1<<" "<<y2<<endl;
	return max(r-l,0LL);
}
inline LL QueryY(LL x,LL y1,LL y2){
	LL l=lower_bound(vey[x].begin(),vey[x].end(),y1)-vey[x].begin();
	LL r=lower_bound(vey[x].begin(),vey[x].end(),y2+1)-vey[x].begin();
	//cout<<"ret2:"<<r-l<<" "<<x<<" "<<y1<<" "<<y2<<endl;
	return max(r-l,0LL);
}
set<node> sx[MAXN+1],sy[MAXN+1];
set<node>::iterator it1,it2;
bool vis[MAXN+1];
queue<LL> que;
map<LL,LL> mpx,mpy;

inline void RmfX(LL x,LL y1,LL y2){
	it1=sx[x].lower_bound(nodde(y1,0));
	it2=sx[x].lower_bound(nodde(y2+1,0));
	LL top=0;
	for(;it1!=it2;++it1){
		node nxt=*it1; ers[++top]=nxt.id;
		if(!vis[nxt.id]){
			vis[nxt.id]=true; que.push(nxt.id);
		}
	} //cout<<x<<" X "<<top<<" "<<sx[x].size()<<endl;
	for(LL i=1;i<=top;i++){
		sy[p[ers[i]].y].erase(nodde(X[p[ers[i]].x],ers[i]));
		sx[p[ers[i]].x].erase(nodde(Y[p[ers[i]].y],ers[i]));
		//if(i<=3) cout<<X[p[ers[i]].x]<<" "<<ers[i]<<" "<<p[ers[i]].x<<endl;
	} return ;
}
inline void RmfY(LL x,LL y1,LL y2){
	it1=sy[x].lower_bound(nodde(y1,0));
	it2=sy[x].lower_bound(nodde(y2+1,0));
	LL top=0;
	for(;it1!=it2;++it1){
		node nxt=(*it1); ers[++top]=nxt.id;
		if(!vis[nxt.id]){
			vis[nxt.id]=true; que.push(nxt.id);
		}
	} //cout<<x<<" Y "<<top<<endl;
	for(LL i=1;i<=top;i++){
		sy[p[ers[i]].y].erase(nodde(X[p[ers[i]].x],ers[i]));
		sx[p[ers[i]].x].erase(nodde(Y[p[ers[i]].y],ers[i]));
	} return ;
}

int main(){
	//freopen("a.in","r",stdin);
	//freopen("a1.out","w",stdout);
	N=read(); A=read(),B=read();
	for(LL i=1;i<=N;i++){
		LL xx=read(),yy=read();
		p[i].x=xx+yy;
		p[i].y=xx-yy;
		p[i].id=i; X[++cntx]=p[i].x; Y[++cnty]=p[i].y;
	} 
	
	K=dist(A,B);
	sort(X+1,X+cntx+1);
	sort(Y+1,Y+cnty+1);
	cntx=unique(X+1,X+cntx+1)-X-1;
	cnty=unique(Y+1,Y+cnty+1)-Y-1;
	
	for(LL i=1;i<=N;i++){
		LL xx=p[i].x,yy=p[i].y;
		p[i].x=lower_bound(X+1,X+cntx+1,p[i].x)-X;
		p[i].y=lower_bound(Y+1,Y+cnty+1,p[i].y)-Y;
		mpx[xx]=p[i].x; mpy[yy]=p[i].y;
		vex[p[i].x].push_back(yy);
		vey[p[i].y].push_back(xx);
		sx[p[i].x].insert(nodde(yy,p[i].id));
		sy[p[i].y].insert(nodde(xx,p[i].id));
		
	}
	
	for(LL i=1;i<=cntx;i++)
		sort(vex[i].begin(),vex[i].end());
	for(LL i=1;i<=cnty;i++)
		sort(vey[i].begin(),vey[i].end());
	sort(p+1,p+N+1,cmpid);
	
	que.push(A); vis[A]=true; LL ans=0,ret=0;
	while(!que.empty()){
		LL k=que.front(); que.pop(); LL v;
		//cout<<k<<endl;
		//cout<<"nd:"<<k<<endl;
		//++ret; ///cout<<ret<<" "<<k<<" "<<que.size()<<endl;
		//cout<<ans<<endl;
		//if(ret==10) return 0;
		v=mpx[X[p[k].x]-K]; if(v){
			ans+=QueryX(v,Y[p[k].y]-K,Y[p[k].y]+K);
			RmfX(v,Y[p[k].y]-K,Y[p[k].y]+K);
		}
		v=mpx[X[p[k].x]+K]; if(v){
			ans+=QueryX(v,Y[p[k].y]-K,Y[p[k].y]+K);
			RmfX(v,Y[p[k].y]-K,Y[p[k].y]+K);
		}
		v=mpy[Y[p[k].y]-K]; if(v){
			ans+=QueryY(v,X[p[k].x]-K+1,X[p[k].x]+K-1);
			RmfY(v,X[p[k].x]-K+1,X[p[k].x]+K-1);
		}
		v=mpy[Y[p[k].y]+K]; if(v){
			ans+=QueryY(v,X[p[k].x]-K+1,X[p[k].x]+K-1);
			RmfY(v,X[p[k].x]-K+1,X[p[k].x]+K-1);
		}
	} //cout<<ans<<endl;
	printf("%lld\n",ans>>1);
	return 0;
}


Measured memory_bytes: 47872