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

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

using namespace std;

#define MAXN 1024
#define MAXH 1000009

#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;

circle c[MAXN];
Hash *h[MAXH];
Hash r[10000000];
vector <int> intersect[MAXN];
int total, covered;
Hash *nn;
int pos;
int cx, cy;
int cc;
double dd;
int ch;

int N, R;

void check(int x, int y) {
    //printf("checking point %d %d\n", x, 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 (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;
}

bool isIn(int x, int y, int idx) {
    cx = c[idx].x;
    cy = c[idx].y;
    
    if (dist(x,y,cx,cy) < R) {
        return true;
    }
    if (dist(x+1,y,cx,cy) < R) {
        return true;
    }
    if (dist(x, y+1, cx, cy) < R) {
        return true;
    }
    if (dist(x+1, y+1, cx, cy) < R) {
        return true;
    }
    return false;
}

void slowSolve() {
    for (int i = 0; i < N; i++) {
        scanf("%d%d", &c[i].x, &c[i].y);
    }
    
    double dr;
    
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            dr = dist(c[i].x, c[i].y, c[j].x, c[j].y);
            if (dr + 2 < 2*R) {
                intersect[i].push_back(j);
            }
        }
    }
    
    int cx, cy;
    int ccx, ccy;
    
    for (int i = 0; i < N; i++) {
        for (int px = c[i].x - R; px <= c[i].x + R; px++) {
            for (int py = c[i].y - R; py <= c[i].y + R; py++) {
                if (isIn(px, py, i)) {
                    check(px, py);
                }
            }
        }
    }
    
    for (int i = 0; i < MAXH; i++) {
        nn = h[i];
        while (nn) {
            total++;
            if (nn->R % 2 == 0) {
                covered++;
            }
            nn = nn->next;
        }
    }
    
    //printf("%d %d %d\n", total, covered, total-covered);   
    printf("%d\n", total-covered);
    
    return;
}

    

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