#include <iostream>
#include <queue>
using namespace std;

struct G{
    int x,y;
    int c;
};

int visited[200][200] = {0};

void bfs(int x,int y,int n){
    int cnt = 0;
    queue<G> q;
    G gtmp;
    G gin;
    gin.x = x;
    gin.y = y;
    gin.c = 0;
    visited[x][y] = 1;
    q.push(gin);
    while(!q.empty()){
        gtmp = q.front();
        // cout << gtmp.x << " " << gtmp.y << " " << visited[gtmp.x][gtmp.y]<< endl;
        q.pop();
        if(gtmp.c==n) break;
            if(visited[gtmp.x+1][gtmp.y]==0){
                gin.x = gtmp.x+1;
                gin.y = gtmp.y;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }
            if(visited[gtmp.x][gtmp.y+1]==0){
                gin.x = gtmp.x;
                gin.y = gtmp.y+1;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }
            if(visited[gtmp.x+1][gtmp.y+1]==0){
                gin.x = gtmp.x+1;
                gin.y = gtmp.y+1;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }            
            if(visited[gtmp.x-1][gtmp.y]==0){
                gin.x = gtmp.x-1;
                gin.y = gtmp.y;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }
            if(visited[gtmp.x][gtmp.y-1]==0){
                gin.x = gtmp.x;
                gin.y = gtmp.y-1;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }
            if(visited[gtmp.x-1][gtmp.y-1]==0){
                gin.x = gtmp.x-1;
                gin.y = gtmp.y-1;
                gin.c = gtmp.c + 1;
                visited[gin.x][gin.y] = 1;
                // cout << gin.c <<  " " << gin.x << " " << gin.y << endl; 
                q.push(gin);
            }

    }
}

int main() {
    // queueに入れる
    while(1){
        int turn,num;
        int x,y;
        int sx,sy;
        int cnt=0;
        cin >> turn >> num;
        if(turn==0&&num==0) break;
        for(int i=0;i<200;i++){
            for(int j=0;j<200;j++){
                visited[i][j] = 0;
            }
        }
        for(int i=0;i<num;i++){
            cin >> x >> y;
            visited[x+100][y+100] = -1; 
        } 
        cin >> sx >> sy;       
        bfs(sx+100,sy+100,turn);
        int ans=0;
        for(int i=0;i<200;i++){
            for(int j=0;j<200;j++){
                // cout << visited[i][j] <<" ";
                if(visited[i][j]==1) ans++;
                // cout << i << " " << j << " " << ans << endl;
            }
            // cout << endl;
        }
        cout << ans << endl;

    }
   
}




Measured memory_bytes: 3316