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

using namespace std;

constexpr static int MAXN = 1e5;

int64_t x[MAXN], y[MAXN];
bool vis[MAXN];
unordered_map <int64_t, set <pair <int64_t, int>>> xysum_vis, xydiff_vis;
unordered_map <int64_t, vector <int64_t>> xysum, xydiff;

void dfs(int i, int goal) {
    if (vis[i])
        return;
    vis[i] = true;
    for (int sum_sgn : {-1, 1}) {
        auto& xyvis = (sum_sgn == 1 ? xysum_vis : xydiff_vis);
        for (int sgn : {-1, 1}) {
            int64_t val = x[i] + y[i] * sum_sgn + goal * sgn;
            int64_t xmin = x[i], xmax = x[i] + goal;
            if (sgn == -1)
                xmin -= goal, xmax -= goal;
            auto iter = xyvis.find(val);
            if (iter == xyvis.end())
                continue;
            auto& s = iter ->second;
            auto iter_set = s.lower_bound({xmin, 0});
            // TODO: optimize by pulling out adj, dfs at end
            vector <pair <int64_t, int>> adj;
            while (iter_set != s.end()) {
                if (iter_set->first > xmax)
                    break;
                adj.push_back(*iter_set);
                iter_set++;
            }
            for (auto& p : adj)
                s.erase(p);
            for (auto& p : adj)
                dfs(p.second, goal);
        }
    }
}

int calc(int i, int64_t goal) {
    int cnt = 0;
    for (int sum_sgn : {-1, 1}) {
        const auto& xylookup = (sum_sgn == 1 ? xysum : xydiff);
        for (int sgn : {-1, 1}) {
            int64_t val = x[i] + y[i] * sum_sgn + goal * sgn;
            auto iter = xylookup.find(val);
            if (iter == xylookup.end())
                continue;
            auto& v = iter->second;
            int64_t xmin = x[i], xmax = x[i];
            if (sum_sgn == 1 && sgn == 1)
                xmax += goal;
            else if (sum_sgn == 1 && sgn == -1)
                xmin -= goal - 1, xmax += 1;
            else if (sum_sgn == -1 && sgn == 1)
                xmin += 1, xmax += goal + 1;
            else
                xmin -= goal;
            auto p1 = lower_bound(v.begin(), v.end(), xmin);
            auto p2 = lower_bound(v.begin(), v.end(), xmax);
            cnt += p2 - p1;
        }
    }
    return cnt;
}

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    a--, b--;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        xysum[x[i] + y[i]].push_back(x[i]);
        xydiff[x[i] - y[i]].push_back(x[i]);
        xysum_vis[x[i] + y[i]].insert({x[i], i});
        xydiff_vis[x[i] - y[i]].insert({x[i], i});
    }
    for (auto& kv : xysum)
        sort(kv.second.begin(), kv.second.end());
    for (auto& kv : xydiff)
        sort(kv.second.begin(), kv.second.end());

    int64_t goal = abs(x[a] - x[b]) + abs(y[a] - y[b]);
    dfs(a, goal);

    int64_t total = 0;
    for (int i = 0; i < n; i++) {
        /*
        cout << i << ": " << calc(i, goal) << " = ";
        int cnt = 0;
        for (int j = 0; j < n; j++)
            if (abs(x[i] - x[j]) + abs(y[i] - y[j]) == goal)
                cnt++;
        cout << cnt << " " << vis[i] << endl;
        */
        if (vis[i])
            total += calc(i, goal);
    }
    cout << total / 2 << endl;
}


Measured memory_bytes: 56836