#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <time.h>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::min;
using std::max;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

namespace MySpace{
    struct Small_Segment_Tree{
        vector<int> a;
        int l, r;

        private:
        int __summ(int L, int R, int l, int r, int v)
        {
            if (L <= l && r <= R)
                return a[v];
            if (R <= l || r <= L)
                return 0;
            int m = (l + r) / 2;
            return __summ(L, R, l, m, 2 * v + 1) + __summ(L, R, m, r, 2 * v + 2);
        }

        void __set(int P, int l, int r, int v, int V)
        {
            if (l + 1 == r)
            {
                a[v] = V;
                return;
            }
            int m = (l + r) / 2;
            if (P < m)
            {
                __set(P, l, m, 2 * v + 1, V);
                a[v] = a[2 * v + 1] + a[2 * v + 2];
            }
            else
            {
                __set(P, m, r, 2 * v + 2, V);
                a[v] = a[2 * v + 1] + a[2 * v + 2];
            }
        }

        public:
        int Summ(int L, int R)
        {
            if (R < L)
                return 0;
            return __summ(L, R + 1, l, r, 0);
        }

        void Set(int P, int V)
        {
            __set(P, l, r, 0, V);
        }

        Small_Segment_Tree(int _n)
        {
            a.resize(4 * _n);
            l = 0, r = _n;
        }
    };
};

using namespace MySpace;

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
int n, a, b;
int x[500000];
int y[500000];
vector<pii> sorted_by_max;
vector<pii> sorted_by_x;
vector<pii> sorted_by_y;
Small_Segment_Tree Sx(110000);
Small_Segment_Tree Sy(110000);

const long long K = 400;
struct Block{
    int l, r;
    int all, del, act;
    int a[K];
    int active_all;
    void active()
    {
        act = all - del;
        active_all = 1;
    }
};

struct Rootery{
    Block A[K];
    void activate(int l, int r)
    {
        while (l % K != 0 && l <= r)
        {
            if (A[l / K].a[l % K] == 0 && A[l / K].active_all == 0)
            {
                A[l / K].a[l % K] = 1;
                A[l / K].act++;
            }
            l++;
        }
        while (r % K != (K - 1) && r >= l)
        {
            if (A[r / K].a[r % K] == 0 && A[r / K].active_all == 0)
            {
                A[r / K].a[r % K] = 1;
                A[r / K].act++;
            }
            r--;
        }
        while (l <= r)
        {
            A[l / K].active();
            l += K;
        }
    }
    int FFAAD()
    {
        for (int i = 0; i < K; i++)
        {
            if (A[i].del != A[i].all)
            {
                if (A[i].act != 0)
                {
                    for (int j = 0; j < K; j++)
                    {
                        if (A[i].a[j] != 2 && (A[i].active_all == 1 || A[i].a[j] == 1))
                        {
                            A[i].act--;
                            A[i].del++;
                            A[i].a[j] = 2;
                            return i * K + j;
                        }
                    }
                }
            }
        }
        return K * K;
    }
    Rootery()
    {
        for (int i = 0; i < K; i++)
        {
            A[i].l = i * K;
            A[i].r = i * K + K;
            A[i].all = K;
        }
    }
};
Rootery Rx, Ry;

bool comp1(pii A, pii B)
{
    return max(abs(A.first - x[a]), abs(A.second - y[a])) < max(abs(B.first - x[a]), abs(B.second - y[a]));
}

bool comp2(pii A, pii B)
{
    pii cA = {A.first, A.second};
    pii cB = {B.first, B.second};
    return cA < cB;
}

bool comp3(pii A, pii B)
{
    pii cA = {A.second, A.first};
    pii cB = {B.second, B.first};
    return cA < cB;
}

int CleverVertical(int x, int y1, int y2, int param)
{
    pair<int, int> p1 = {x, y1};
    pair<int, int> p2 = {x, y2};
    int l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (sorted_by_x[m] < p1)
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    int L = l + 1;
    l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (sorted_by_x[m] <= p2)
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    int R = l;
    if (param == 1)
    {
        Rx.activate(L, R);
    }
    return Sx.Summ(L, R);
}

bool less(pii A, pii B)
{
    if (A.second < B.second)
        return 1;
    if (A.second > B.second)
        return 0;
    if (A.first < B.first)
        return 1;
    return 0;
}

bool less_or_equal(pii A, pii B)
{
    if (A.second < B.second)
        return 1;
    if (A.second > B.second)
        return 0;
    if (A.first <= B.first)
        return 1;
    return 0;
}

int CleverHorizontal(int y, int x1, int x2, int param)
{
    pair<int, int> p1 = {x1, y};
    pair<int, int> p2 = {x2, y};
    int l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (less(sorted_by_y[m], p1))
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    int L = l + 1;
    l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (less_or_equal(sorted_by_y[m], p2))
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    int R = l;
    if (param == 1)
    {
        Ry.activate(L, R);
    }
    return Sy.Summ(L, R);
}

void Mark(int x, int y)
{
    pair<int, int> p = {x, y};
    int l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (sorted_by_x[m] < p)
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    Sx.Set(r, 1);
    l = -1, r = n;
    while (l + 1 < r)
    {
        int m = (l + r) / 2;
        if (less(sorted_by_y[m], p))
        {
            l = m;
        }
        else
        {
            r = m;
        }
    }
    Sy.Set(r, 1);
}

signed main()
{
    srand(time(NULL));
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> a >> b;
    a--, b--;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
        int X = x[i] + y[i];
        int Y = x[i] - y[i];
        x[i] = X, y[i] = Y;
        sorted_by_max.push_back({x[i], y[i]});
        sorted_by_x.push_back({x[i], y[i]});
        sorted_by_y.push_back({x[i], y[i]});
    }
    random_shuffle(all(sorted_by_max));
    sort(all(sorted_by_x), comp2);
    sort(all(sorted_by_y), comp3);
    int D = max(abs(x[a] - x[b]), abs(y[a] - y[b]));
    Mark(x[a], y[a]);
    int cnt = CleverVertical(x[a] - D, y[a] - D, y[a] + D - 1, 1) + CleverVertical(x[a] + D, y[a] - D + 1, y[a] + D, 1)
    + CleverHorizontal(y[a] - D, x[a] - D + 1, x[a] + D, 1) + CleverHorizontal(y[a] + D, x[a] - D, x[a] + D - 1, 1);
    for (int i = 0; i < 2 * n; i++)
    {
        int j = -1;
        j = Rx.FFAAD();
        //cout << j << endl;
        if (j == K * K)
        {
            j = Ry.FFAAD();
            if (j == K * K)
            {
                break;
            }
            int x = sorted_by_y[j].first;
            int y = sorted_by_y[j].second;
            Mark(x, y);
            int cnt = CleverVertical(x - D, y - D, y + D - 1, 1) + CleverVertical(x + D, y - D + 1, y + D, 1)
            + CleverHorizontal(y - D, x - D + 1, x + D, 1) + CleverHorizontal(y + D, x - D, x + D - 1, 1);
            continue;
        }
        int x = sorted_by_x[j].first;
        int y = sorted_by_x[j].second;
        Mark(x, y);
        int cnt = CleverVertical(x - D, y - D, y + D - 1, 1) + CleverVertical(x + D, y - D + 1, y + D, 1)
        + CleverHorizontal(y - D, x - D + 1, x + D, 1) + CleverHorizontal(y + D, x - D, x + D - 1, 1);
    }
    long long ans = 0;
    for (int i = 0; i < n; i++)
    {
        int x = sorted_by_max[i].first;
        int y = sorted_by_max[i].second;
        int cnt = CleverVertical(x - D, y - D, y + D - 1, 0) + CleverVertical(x + D, y - D + 1, y + D, 0)
        + CleverHorizontal(y - D, x - D + 1, x + D, 0) + CleverHorizontal(y + D, x - D, x + D - 1, 0);
        ans += cnt;
    }
    cout << ans / 2;
}


Measured memory_bytes: 10080