#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

typedef pair<long, long> P;

map<P, long> mc;
map<long, set<long>> mx, my;
map<long, vector<long>> vx, vy;
long cnt = 0;
void dfs(long x, long y, long k){
    cnt += mc[P(x, y)];
    vector<long> v;
    if(mx.count(x-k) != 0){
        auto pl = mx[x-k].lower_bound(y-k);
        auto pr = mx[x-k].upper_bound(y+k);
        for(auto iter = pl; iter != pr; iter++){
            my[*iter].erase(x-k);
            v.push_back(*iter);
        }
        mx[x-k].erase(pl, pr);
        for(auto iter = v.begin(); iter != v.end(); iter++){
            dfs(x-k, *iter, k);
        }
    }
    v.clear();
    if(mx.count(x+k) != 0){
        auto pl = mx[x+k].lower_bound(y-k);
        auto pr = mx[x+k].upper_bound(y+k);
        for(auto iter = pl; iter != pr; iter++){
            my[*iter].erase(x+k);
            v.push_back(*iter);
        }
        mx[x+k].erase(pl, pr);
        for(auto iter = v.begin(); iter != v.end(); iter++){
            dfs(x+k, *iter, k);
        }
    }
    v.clear();
    if(my.count(y-k) != 0){
        auto pl = my[y-k].lower_bound(x-k);
        auto pr = my[y-k].upper_bound(x+k);
        for(auto iter = pl; iter != pr; iter++){
            mx[*iter].erase(y-k);
            v.push_back(*iter);
        }
        my[y-k].erase(pl, pr);
        for(auto iter = v.begin(); iter != v.end(); iter++){
            dfs(*iter, y-k, k);
        }
    }
    v.clear();
    if(my.count(y+k) != 0){
        auto pl = my[y+k].lower_bound(x-k);
        auto pr = my[y+k].upper_bound(x+k);
        for(auto iter = pl; iter != pr; iter++){
            mx[*iter].erase(y+k);
            v.push_back(*iter);
        }
        my[y+k].erase(pl, pr);
        for(auto iter = v.begin(); iter != v.end(); iter++){
            dfs(*iter, y+k, k);
        }
    }
}

int main(){
    long N;
    long a, b;
    cin >> N >> a >> b;
    a--;
    b--;
    long xa, xb, ya, yb;
    for(long i = 0; i < N; i++){
        long x, y, x_, y_;
        cin >> x_ >> y_;
        x = x_+y_;
        y = x_-y_;
        if(mx.count(x) == 0){
            mx[x] = {y};
            vx[x] = {y};
        }else{
            mx[x].insert(y);
            vx[x].push_back(y);
        }
        if(my.count(y) == 0){
            my[y] = {x};
            vy[y] = {x};
        }else{
            my[y].insert(x);
            vy[y].push_back(x);
        }
        if(i == a){
            xa = x;
            ya = y;
        }
        if(i == b){
            xb = x;
            yb = y;
        }
    }
    long k = max(abs(xa-xb), abs(ya-yb));
    for(auto i = mx.begin(); i != mx.end(); i++){
        int m = i->first;
        sort(vx[m].begin(), vx[m].end());
    }
    for(auto i = my.begin(); i != my.end(); i++){
        int m = i->first;
        sort(vy[m].begin(), vy[m].end());
    }
    for(auto i = mx.begin(); i != mx.end(); i++){
        for(auto j = i->second.begin(); j != i->second.end(); j++){
            long x = i->first;
            long y = *j;
            long sum = 0;
            if(vx.count(x-k) != 0){
                auto pl = lower_bound(vx[x-k].begin(), vx[x-k].end(), y-k);
                auto pr = upper_bound(vx[x-k].begin(), vx[x-k].end(), y+k);
                sum += pr-pl;
            }
            if(vx.count(x+k) != 0){
                auto pl = lower_bound(vx[x+k].begin(), vx[x+k].end(), y-k);
                auto pr = upper_bound(vx[x+k].begin(), vx[x+k].end(), y+k);
                sum += pr-pl;
            }
            if(vy.count(y-k) != 0){
                auto pl = lower_bound(vy[y-k].begin(), vy[y-k].end(), x-k+1);
                auto pr = upper_bound(vy[y-k].begin(), vy[y-k].end(), x+k-1);
                sum += pr-pl;
            }
            if(vy.count(y+k) != 0){
                auto pl = lower_bound(vy[y+k].begin(), vy[y+k].end(), x-k+1);
                auto pr = upper_bound(vy[y+k].begin(), vy[y+k].end(), x+k-1);
                sum += pr-pl;
            }
            mc[P(x, y)] = sum;
        }
    }
    
    mx[xa].erase(ya);
    my[ya].erase(xa);
    dfs(xa, ya, k);
    cout << cnt/2 << endl;
}   

Measured memory_bytes: 64256