#include <iostream>
#include <queue>

using namespace std;

#define FIELDSIZE 200
#define INF 10000

int field[FIELDSIZE][FIELDSIZE];
int offset = 100;

struct tile{
    int x, y;
    int turn;
    tile(int x, int y, int turn) : x(x), y(y), turn(turn) {};
};

void init() {
    for (int i = 0; i < FIELDSIZE; i++) {
        for (int j = 0; j < FIELDSIZE; j++) {
            field[i][j] = -1;
        }
    }
//    field[0+offset][0+offset] = 0;
//    field[-31+offset][0+offset] = INF;
//    field[31+offset][0+offset] = INF;
//    field[0+offset][31+offset] = INF;
//    field[0+offset][-31+offset] = INF;
//    field[31+offset][31+offset] = INF;
//    field[-31+offset][-31+offset] = INF;
}

//int count = 0;
//void visit(int x, int y, int turn) {
//    if (field[x+offset][y+offset] == INF) {
//        return;
//    }
//    if (field[x+offset][y+offset] == -1) {
//        field[x+offset][y+offset] = turn;
//        count++;
//    }
//
//    visit(x+1, y, turn+1);
//    visit(x-1, y, turn+1);
//    visit(x, y+1, turn+1);
//    visit(x, y-1, turn+1);
//    visit(x+1, y+1, turn+1);
//    visit(x-1, y-1, turn+1);
//}


int main() {
    int last_t, n;

    while (cin >> last_t >> n) {
        if (last_t == 0 && n == 0) break;
        init();
        for (int i = 0; i < n; i++) {
            int x, y;
            cin >> x >> y;
            field[x+offset][y+offset] = INF;
        }
        int start_x, start_y;
        cin >> start_x >> start_y;
        queue<tile> q;
        q.push(tile(start_x, start_y, 0));
        field[start_x+offset][start_y+offset] = 0;
        while (!q.empty()) {
            tile t = q.front(); q.pop();
//            cout << q.size() << endl;
//            field[t.x+offset][t.y+offset] = t.turn;
            //cout << t.x << endl;

            if (t.turn == last_t) {
                continue;
            }

            if (field[t.x+1+offset][t.y+offset] == -1) {
                field[t.x+1+offset][t.y+offset] = t.turn+1;
                q.push(tile(t.x+1, t.y, t.turn+1));
            }
            if (field[t.x-1+offset][t.y+offset] == -1) {
                field[t.x-1+offset][t.y+offset] = t.turn+1;
                q.push(tile(t.x-1, t.y, t.turn+1));
            }
            if (field[t.x+offset][t.y+1+offset] == -1) {
                field[t.x+offset][t.y+1+offset] = t.turn+1;
                q.push(tile(t.x, t.y+1, t.turn+1));
            }
            if (field[t.x+offset][t.y-1+offset] == -1) {
                field[t.x+offset][t.y-1+offset] = t.turn+1;
                q.push(tile(t.x, t.y-1, t.turn+1));
            } 
            if (field[t.x+1+offset][t.y+1+offset] == -1) {
                field[t.x+1+offset][t.y+1+offset] = t.turn+1;
                q.push(tile(t.x+1, t.y+1, t.turn+1));
            }
            if (field[t.x-1+offset][t.y-1+offset] == -1) {
                field[t.x-1+offset][t.y-1+offset] = t.turn+1;
                q.push(tile(t.x-1, t.y-1, t.turn+1));
            }
        }
        int count = 0;
        for (int i = 0; i < FIELDSIZE; i++) {
            for (int j = 0; j < FIELDSIZE; j++) {
                if (field[i][j] != -1 && field[i][j] != INF) {
                    count++;
                }
            }
        }
        cout << count << endl;
    }
    return 0;
}

Measured memory_bytes: 0