#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define int long long



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int  n,a,b;
    cin >> n >> a >> b;
    a--;b--;
    vector<int> x(n),y(n);
    rep(i,n){
        int c,d;
        cin >> c >> d;
        x[i] = c+d;
        y[i] = c-d;
    }
    int d = max(abs(x[a]-x[b]),abs(y[a]-y[b]));
    map<int,set<int>  > mpx,mpy;
    map<int,vector<int>  > mpx2,mpy2;
    map<pair<int,int>,int > num;
    rep(i,n){
        mpx2[x[i]].push_back(y[i]);
        mpy2[y[i]].push_back(x[i]);
        if(i==a)continue;
        num[MP(x[i],y[i])] = i;
        mpx[x[i]].insert(y[i]);
        mpy[y[i]].insert(x[i]);
    }
    for(auto &aa:mpx2){
        vector<int>&aaa = aa.second;
        sort(aaa.begin(),aaa.end());
    }
    for(auto &aa:mpy2){
        vector<int>&aaa = aa.second;
        sort(aaa.begin(),aaa.end());   
    }
    set<int> st;
    st.insert(a);
    queue<int> q;
    q.push(a);
    int res = 0;
    while(!q.empty()){
        int k = q.front();
        q.pop();
        
        int sx = x[k] + d;
        set<int>&t = mpx[sx];
        auto tmp = t.lower_bound(y[k]-d);
        vector<int> &p = mpx2[sx];
        int sss = upper_bound(p.begin(),p.end(),y[k]+d)-lower_bound(p.begin(),p.end(),y[k]-d);
        res += sss;
        while(tmp!=t.end()){
            int yy = (*tmp);
            if(yy<=y[k]+d){
                int cc = num[MP(sx,yy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = t.erase(tmp);
                mpy[y[cc]].erase(x[cc]);
            }else{
                break;
            }
        }
        sx = x[k] - d;
        set<int>&tt = mpx[sx];
        tmp = tt.lower_bound(y[k]-d);
        vector<int> &pp = mpx2[sx];
        sss = upper_bound(pp.begin(),pp.end(),y[k]+d)-lower_bound(pp.begin(),pp.end(),y[k]-d);
        res += sss;
        
        while(tmp!=tt.end()){
            int yy = (*tmp);
            if(yy<=y[k]+d){
                int cc = num[MP(sx,yy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = tt.erase(tmp);
                mpy[y[cc]].erase(x[cc]);
            }else{
                break;
            }
        }
        int sy = y[k] + d;
        set<int>&ttt = mpy[sy];
        tmp = ttt.lower_bound(x[k]-d);
        vector<int> &ppp = mpy2[sy];
        sss = lower_bound(ppp.begin(),ppp.end(),x[k]+d)-upper_bound(ppp.begin(),ppp.end(),x[k]-d);
        res += sss;
        
        while(tmp!=ttt.end()){
            int xx = (*tmp);
            if(xx<=x[k]+d){
                int cc = num[MP(xx,sy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = ttt.erase(tmp);
                mpx[x[cc]].erase(y[cc]);
            }else{
                break;
            }
        }
        sy = y[k]-d;
        set<int>&tttt = mpy[sy];
        tmp = tttt.lower_bound(x[k]-d);
        vector<int> &pppp = mpy2[sy];
        sss = lower_bound(pppp.begin(),pppp.end(),x[k]+d)-upper_bound(pppp.begin(),pppp.end(),x[k]-d);
        res += sss;
        
        while(tmp!=tttt.end()){
            int xx = (*tmp);
            if(xx<=x[k]+d){
                int cc = num[MP(xx,sy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = tttt.erase(tmp);
                mpx[x[cc]].erase(y[cc]);
            }else{
                break;
            }
        }
        //cerr << k << " " << res << endl;
    }
    // for(auto x:st){
    //     cerr << x << " ";
    // }
    // cerr << endl;
    cout << res/2 << endl;
    return 0;
}

Measured memory_bytes: 81152