#include <bits/stdc++.h>
using namespace std;

struct UnionFind {
    vector<int> parent, size;

    UnionFind(int n) : parent(n), size(n, 1) {
        for (int i = 0; i < n; i++) {
            parent[i] = i;
        }
    }

    int operator[](int x) {
        if (parent[x] == x) return x;
        return parent[x] = operator[](parent[x]);
    }

    bool merge(int x, int y) {
        x = operator[](x);
        y = operator[](y);
        if (x == y) return false;
        if (size[x] < size[y]) swap(x, y);
        parent[y] = x;
        size[x] += size[y];
        return true;
    }

    int getSize(int x) {
        return size[operator[](x)];
    }
};

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    a--;
    b--;

    UnionFind uf(n);
    vector<long long> xs(n), ys(n);
    map<long long, vector<pair<long long, int>>> mp0, mp1;
    map<pair<long long, long long>, int> xy;
    for (int i = 0; i < n; i++) {
        scanf("%lld %lld", &xs[i], &ys[i]);
        long long x = xs[i];
        long long y = ys[i];
        xs[i] = x - y + (int)1e9;
        ys[i] = x + y + (int)1e9;
        mp0[xs[i]].emplace_back(ys[i], i);
        mp1[ys[i]].emplace_back(xs[i], i);
        xy[make_pair(xs[i], ys[i])] = i;
    }
    for (auto &kv : mp0) {
        sort(kv.second.begin(), kv.second.end());
    }
    for (auto &kv : mp1) {
        sort(kv.second.begin(), kv.second.end());
    }

    long long ans = 0;
    long long d = max(abs(xs[a] - xs[b]), abs(ys[a] - ys[b]));
    uf.merge(a, b);

    auto f = [&](map<long long, vector<pair<long long, int>>> mp) {
        vector<long long> keys;
        for (auto kv : mp) {
            keys.push_back(kv.first);
        }
        for (long long x0 : keys) {
            long long x1 = x0 + d;
            vector<pair<long long, int>> &y0 = mp[x0];
            vector<pair<long long, int>> &y1 = mp[x1];

            int l = 0;
            int r = 0;
            for (int i = 0; i < y0.size(); i++) {
                while (l < y1.size() && y1[l].first < y0[i].first - d) {
                    l++;
                }
                r = max(l, r);
                while (r < y1.size() && y1[r].first <= y0[i].first + d) {
                    uf.merge(y1[l].second, y1[r].second);
                    r++;
                }

                for (int j = l; j < min(r, l + 10); j++) {
                    uf.merge(y0[i].second, y1[j].second);
                }
                for (int j = max(l, r - 10); j < r; j++) {
                    uf.merge(y0[i].second, y1[j].second);
                }
            }
        }
    };

    auto g = [&](map<long long, vector<pair<long long, int>>> mp) {
        vector<long long> keys;
        for (auto kv : mp) {
            keys.push_back(kv.first);
        }
        for (long long x0 : keys) {
            long long x1 = x0 + d;
            vector<pair<long long, int>> &y0 = mp[x0];
            vector<pair<long long, int>> &y1 = mp[x1];

            int l = 0;
            int r = 0;
            for (int i = 0; i < y0.size(); i++) {
                while (l < y1.size() && y1[l].first < y0[i].first - d) {
                    l++;
                }
                while (r < y1.size() && y1[r].first <= y0[i].first + d) {
                    r++;
                }
                if (uf[a] == uf[y0[i].second]) {
                    ans += r - l;
                }
            }
        }
    };

    f(mp0);
    f(mp1);
    g(mp0);
    g(mp1);

    for (auto kv : xy) {
        if (uf[a] == uf[kv.second]) {
            long long x = kv.first.first;
            long long y = kv.first.second;
            ans -= xy.count(make_pair(x + d, y + d));
            ans -= xy.count(make_pair(x + d, y - d));
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 42828