#include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3fll
typedef long long ll;
typedef pair<int,int> pii;
typedef unsigned long long ull;
const int maxn=1e5+10;
ll px[maxn],py[maxn];
int pc[maxn],pd[maxn];
int n,a,b;
vector<ll> lshc,lshd;
vector<ll> cls[maxn],dls[maxn];
set<pair<ll,int> > cs[maxn],ds[maxn];
set<pair<ll,int> >::iterator it,it2;
int vis[maxn];
bool less2(int x,int y)
{
	return px[x]<px[y];
}
void getpoints(int id,int base)
{
	if(vis[id])return;
	vis[id]=base;
	ll dis=abs(px[id]-px[base])+abs(py[id]-py[base]);
	ll curc,curd;
	int cid,did;
	vector<int> canvis;
	canvis.clear();
	//x-y=x1-y1+dis  x1<=x<=x1+dis
	curd=px[id]-py[id]+dis;
	did=lower_bound(lshd.begin(),lshd.end(),curd)-lshd.begin();
	if(did<lshd.size()&&lshd[did]==curd&&!ds[did].empty())
	{
		it=ds[did].lower_bound(make_pair(px[id],0));
		while(it!=ds[did].end())
		{
			if((*it).first>(px[id]+dis))break;
			canvis.push_back((*it).second);
			it2=it;
			++it;
			ds[did].erase(it2);
		}
	}
	//x+y=x1+y1+dis   x1<=x<=x1+dis
	curc=px[id]+py[id]+dis;
	cid=lower_bound(lshc.begin(),lshc.end(),curc)-lshc.begin();
	if(cid<lshc.size()&&lshc[cid]==curc&&!cs[cid].empty())
	{
		it=cs[cid].lower_bound(make_pair(px[id],0));
		while(it!=cs[cid].end())
		{
			if((*it).first>(px[id]+dis))break;
			canvis.push_back((*it).second);
			it2=it;
			++it;
			cs[cid].erase(it2);
		}
	}
	//x-y=x1-y1-dis   x1-dis<=x<=x1
	curd=px[id]-py[id]-dis;
	did=lower_bound(lshd.begin(),lshd.end(),curd)-lshd.begin();
	if(did<lshd.size()&&lshd[did]==curd&&!ds[did].empty())
	{
		it=ds[did].lower_bound(make_pair(px[id]-dis,0));
		while(it!=ds[did].end())
		{
			if((*it).first>(px[id]))break;
			canvis.push_back((*it).second);
			it2=it;
			++it;
			ds[did].erase(it2);
		}
	}
	//x+y=x1+y1-dis   x1-dis<=x<=x1
	curc=px[id]+py[id]-dis;
	cid=lower_bound(lshc.begin(),lshc.end(),curc)-lshc.begin();
	if(cid<lshc.size()&&lshc[cid]==curc&&!cs[cid].empty())
	{
		it=cs[cid].lower_bound(make_pair(px[id]-dis,0));
		while(it!=cs[cid].end())
		{
			if((*it).first>(px[id]))break;
			canvis.push_back((*it).second);
			it2=it;
			++it;
			cs[cid].erase(it2);
		}
	}
	
	for(int i=0;i<canvis.size();i++)
	{
		getpoints(canvis[i],id);
		getpoints(id,canvis[i]);
	}
}
vector<int> all;
int main()
{
	scanf("%d%d%d",&n,&a,&b);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld%lld",&px[i],&py[i]);
		//x+y=c
		lshc.push_back(px[i]+py[i]);
		//x-y=d
		lshd.push_back(px[i]-py[i]);
	}
	sort(lshc.begin(),lshc.end());
	sort(lshd.begin(),lshd.end());
	lshc.erase(unique(lshc.begin(),lshc.end()),lshc.end());
	lshd.erase(unique(lshd.begin(),lshd.end()),lshd.end());
	for(int i=1;i<=n;i++)
	{
		pc[i]=lower_bound(lshc.begin(),lshc.end(),px[i]+py[i])-lshc.begin();
		pd[i]=lower_bound(lshd.begin(),lshd.end(),px[i]-py[i])-lshd.begin();
		cls[pc[i]].push_back(px[i]);
		dls[pd[i]].push_back(px[i]);
		cs[pc[i]].insert(make_pair(px[i],i));
		ds[pd[i]].insert(make_pair(px[i],i));
	}
	for(int i=0;i<lshc.size();i++)
	{
		sort(cls[i].begin(),cls[i].end());
	}
	for(int i=0;i<lshd.size();i++)
	{
		sort(dls[i].begin(),dls[i].end());
	}
	getpoints(a,b);
	getpoints(b,a);
	ll ans=0;
	for(int i=1;i<=n;i++)
	{
		if(!vis[i])continue;
		ll curc,curd;
		int cid,did;
		int base=vis[i];
		ll dis=abs(px[i]-px[base])+abs(py[i]-py[base]);
	//	cout<<i<<" "<<base<<" "<<dis<<endl;
		//x-y=x1-y1+dis  x1<=x<x1+dis
		curd=px[i]-py[i]+dis;
		did=lower_bound(lshd.begin(),lshd.end(),curd)-lshd.begin();
		if(did<lshd.size()&&lshd[did]==curd)
		{
			int p1=lower_bound(dls[did].begin(),dls[did].end(),px[i])-dls[did].begin();
			int p2=lower_bound(dls[did].begin(),dls[did].end(),px[i]+dis)-dls[did].begin();
		//	if(p2<dls[did].size()&&dls[did][p2]==px[i]+dis)p2--;
			ans+=(p2-p1);
		//	cout<<i<<" "<<p2-p1<<endl;
		}
		//x+y=x1+y1+dis   x1<x<=x1+dis
		curc=px[i]+py[i]+dis;
		cid=lower_bound(lshc.begin(),lshc.end(),curc)-lshc.begin();
		if(cid<lshc.size()&&lshc[cid]==curc)
		{
			int p1=lower_bound(cls[cid].begin(),cls[cid].end(),px[i])-cls[cid].begin();
			int p2=lower_bound(cls[cid].begin(),cls[cid].end(),px[i]+dis+1)-cls[cid].begin();
			if(p1<cls[cid].size()&&cls[cid][p1]==px[i])p1++;
		//	cout<<"?? "<<p1<<" "<<cls[cid].size()<<" "<<cls[cid][p1]<<" "<<p2<<" "<<cls[cid][p2-1]<<endl;
			ans+=(p2-p1);
		//	cout<<i<<" "<<p2-p1<<endl;
		}
		//x-y=x1-y1-dis   x1-dis<x<=x1
		curd=px[i]-py[i]-dis;
		did=lower_bound(lshd.begin(),lshd.end(),curd)-lshd.begin();
		if(did<lshd.size()&&lshd[did]==curd)
		{
			int p1=lower_bound(dls[did].begin(),dls[did].end(),px[i]-dis)-dls[did].begin();
			int p2=lower_bound(dls[did].begin(),dls[did].end(),px[i]+1)-dls[did].begin();
			if(p1<dls[did].size()&&dls[did][p1]==px[i]-dis)p1++;
			ans+=(p2-p1);
		//	cout<<i<<" "<<p2-p1<<endl;
		}
		//x+y=x1+y1-dis   x1-dis<=x<x1
		curc=px[i]+py[i]-dis;
		cid=lower_bound(lshc.begin(),lshc.end(),curc)-lshc.begin();
		if(cid<lshc.size()&&lshc[cid]==curc)
		{
			int p1=lower_bound(cls[cid].begin(),cls[cid].end(),px[i]-dis)-cls[cid].begin();
			int p2=lower_bound(cls[cid].begin(),cls[cid].end(),px[i])-cls[cid].begin();
		//	if(p2<cls[cid].size()&&cls[cid][p2]==px[i])p2--;
			ans+=(p2-p1);
		//	cout<<i<<" "<<p2-p1<<endl;
		}
	}
	printf("%lld\n",ans/2);
	return 0;
}

Measured memory_bytes: 41068