#include<bits/stdc++.h>
using namespace std;
#define pii pair<ll,ll>
#define ll long long
#define inf 2333333333333333333LL
  
struct hhhh { ll x,y; }a[100010];
  
vector<ll> s1[200010],s2[200010];
set<pii> t1[200010],t2[200010];
queue<ll> q;

pii p[200010];
  
ll h[200010],n,d,vs,vt,tt;
bool inq[200010];
  
inline ll rd()
{
    ll x=0;char ch=getchar();
    for (;ch<'0'||ch>'9';ch=getchar());
    for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
    return x;
}
  
inline ll query1(ll x,ll l,ll r)
{
    if (!x||x==tt+1) return 0;
    ll it1=lower_bound(s1[x].begin(),s1[x].end(),l)-s1[x].begin();
    ll it2=upper_bound(s1[x].begin(),s1[x].end(),r)-s1[x].begin();
    return it2-it1;
}
  
inline ll query2(ll x,ll l,ll r)
{
    if (!x||x==tt+1) return 0;
    if (l>r) return 0;
    ll it1=lower_bound(s2[x].begin(),s2[x].end(),l)-s2[x].begin();
    ll it2=upper_bound(s2[x].begin(),s2[x].end(),r)-s2[x].begin();
    return it2-it1;
}
  
inline void gao1(ll x,ll l,ll r)
{
    if (!x||x==tt+1) return;
    set<pii>::iterator it1=t1[x].lower_bound(pii(l,0));
    set<pii>::iterator it2=t1[x].upper_bound(pii(r,n));
    ll tot=0;
    for (set<pii>::iterator it=it1;it!=it2;it++)
    {
        pii hh=*it;p[++tot]=hh;
        if (!inq[hh.second]) q.push(hh.second),inq[hh.second]=true;
    }
    for (ll i=1;i<=tot;i++) t1[x].erase(p[i]);
}
  
inline void gao2(ll x,ll l,ll r)
{
    if (!x||x==tt+1) return;
    set<pii>::iterator it1=t2[x].lower_bound(pii(l,0));
    set<pii>::iterator it2=t2[x].upper_bound(pii(r,n));
    ll tot=0;
    for (set<pii>::iterator it=it1;it!=it2;it++)
    {
        pii hh=*it;p[++tot]=hh;
        if (!inq[hh.second]) q.push(hh.second),inq[hh.second]=true;
    }
    for (ll i=1;i<=tot;i++) t2[x].erase(p[i]);
}
  
int main()
{
    n=rd();vs=rd();vt=rd();
    for (ll i=1;i<=n;i++) { ll x=rd(),y=rd();a[i].x=x+y;a[i].y=y-x; }
    tt=0;
    for (ll i=1;i<=n;i++) h[++tt]=a[i].x,h[++tt]=a[i].y;
    sort(h+1,h+tt+1);
    tt=unique(h+1,h+tt+1)-h-1;
    for (ll i=1;i<=n;i++) a[i].x=lower_bound(h+1,h+tt+1,a[i].x)-h,a[i].y=lower_bound(h+1,h+tt+1,a[i].y)-h;
    d=max(abs(h[a[vs].x]-h[a[vt].x]),abs(h[a[vs].y]-h[a[vt].y]));
    for (ll i=1;i<=n;i++)
    {
        s1[a[i].x].push_back(h[a[i].y]);s2[a[i].y].push_back(h[a[i].x]);
        t1[a[i].x].insert(pii(h[a[i].y],i));t2[a[i].y].insert(pii(h[a[i].x],i));
    }
    for (int i=1;i<=tt;i++) sort(s1[i].begin(),s1[i].end()),sort(s2[i].begin(),s2[i].end());
    ll ans=0LL;
    q.push(vs);inq[vs]=true;
    while (!q.empty())
    {
        ll x=q.front();q.pop();
        ll h1=lower_bound(h+1,h+tt+1,h[a[x].x]+d)-h;
        ll h2=lower_bound(h+1,h+tt+1,h[a[x].x]-d)-h;
        ll h3=lower_bound(h+1,h+tt+1,h[a[x].y]+d)-h;
        ll h4=lower_bound(h+1,h+tt+1,h[a[x].y]-d)-h;
        if (h[h1]!=h[a[x].x]+d) h1=tt+1;
        if (h[h2]!=h[a[x].x]-d) h2=0;
        if (h[h3]!=h[a[x].y]+d) h3=tt+1;
        if (h[h4]!=h[a[x].y]-d) h4=0;
        ans+=query1(h1,h[a[x].y]-d,h[a[x].y]+d)+query1(h2,h[a[x].y]-d,h[a[x].y]+d);
        ans+=query2(h3,h[a[x].x]-d+1,h[a[x].x]+d-1)+query2(h4,h[a[x].x]-d+1,h[a[x].x]+d-1);
        gao1(h1,h[a[x].y]-d,h[a[x].y]+d);gao1(h2,h[a[x].y]-d,h[a[x].y]+d);
        gao2(h3,h[a[x].x]-d,h[a[x].x]+d);gao2(h4,h[a[x].x]-d,h[a[x].x]+d);
    }
    printf("%lld\n",ans>>1);
    return 0;
}

Measured memory_bytes: 51832