/*
TASK:COLXOR
LANG:C++
*/

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

#define MAXN 1024
#define MAXH 1000009
#define MAXR 8000000

#define dist(x1, y1, x2, y2) sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)))

typedef struct circle {
    int x, y;
}circle;

typedef struct Hash {
    int x;
    int y;
    int R;
    Hash *next;
}Hash;

Hash *h[MAXH];
Hash r[MAXR];
int total, covered;
Hash *nn;
int pos;
int cx, cy;
int ch;

int N, R;

void check(int x, int y) {
    
    ch = ((x+11005)*21010 + y + 11005) % MAXH;
    
    nn = h[ch];
    
    while (nn) {
        if (nn->x == x && nn->y == y) {
            nn->R++;
            return;
        }
        nn = nn->next;
    }
    
    if (pos == MAXR) {
        Hash * cur = new Hash;
        if (h[ch] != NULL) {
            cur->next = h[ch]->next;
            h[ch]->next = cur;
        }
        else {
            h[ch] = cur;
        }
        cur->x = x;
        cur->y = y;
        cur->R = 1;
        return;
    }
    
    if (h[ch] != NULL) {
        r[pos].next = h[ch]->next;
        h[ch]->next = &r[pos];
    }
    else {
        h[ch] = &r[pos];
    }
    r[pos].x = x;
    r[pos].y = y;
    r[pos].R = 1;
    pos++;
    
    return;
}

void slowSolve() {

    for (int i = 0; i < N; i++) {
        scanf("%d%d", &cx, &cy);
        for (int px = cx - R; px <= cx + R; px++) {
            for (int py = cy - R; py <= cy + R; py++) {
                if (dist(px,py,cx,cy) < R) {
                    check(px, py);
                    continue;
                }
                if (dist(px+1,py,cx,cy) < R) {
                    check(px, py);
                    continue;
                }
                if (dist(px, py+1, cx, cy) < R) {
                    check(px, py);
                    continue;
                }
                if (dist(px+1, py+1, cx, cy) < R) {
                    check(px, py);
                    continue;
                }
            }
        }
    }
    
    for (int i = 0; i < MAXH; i++) {
        nn = h[i];
        while (nn) {
            total++;
            if (nn->R % 2 == 0) {
                covered++;
            }
            nn = nn->next;
        }
    }
    
    printf("%d\n", total-covered);
    
    return;
}

    

int main() {
    
    scanf("%d%d", &N, &R);
    slowSolve();
    
    return 0;
}
