/*
TASK: colxor
LANG: C++
*/

#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

const int    MAX_N   = 1000+5;
const int    MAX_R   = 1000+5;
const int    MAX_VAL = 10000;
const double eps     = 1e-9;

struct point { int x, y; };

int n, R, sqrR;
point A[MAX_N];
int ans=0;

int M[MAX_N*2];

int LOWER = 2*MAX_VAL;
int UPPER = -2*MAX_VAL;

void input ()
{
     int i;
     
     scanf ("%d%d", &n, &R);
     sqrR = R*R;
     
     for (i=0; i<n; i++) {
         scanf ("%d%d", &A[i].x, &A[i].y);
     
         LOWER = min(LOWER,A[i].x-R);
         UPPER = max(UPPER,A[i].x+R);
              
         A[i].y += 2*MAX_VAL;
     }
}

double sqr (double p) { return p*p; }

int column (double x)
{
    int i, j, res=0, l=0;
    double D, Y0, Y1;
    
    for (i=0; i<n; i++) {
        if (x<A[i].x-R || x>A[i].x+R) continue;
        
        D = sqrt( sqrR-sqr(x-A[i].x) );
        
        M[l++] = int(floor(A[i].y-D+eps)+eps);
        M[l++] = int(ceil(A[i].y+D-eps)+eps);    
    }
    
    sort (M, M+l);
    
    for (i=1; i<l; i++)
        if (i&1)
           res += (M[i]-M[i-1]);
    
    return res;
}

void solve ()
{
     int i;
     
     //for (i=-(MAX_VAL+MAX_R); i<=+(MAX_VAL+MAX_R); i++)
     for (i=LOWER-5; i<=UPPER+5; i++)
         ans += column (double(i)+0.5);
}

int main ()
{
    //freopen ("colxor.in", "r", stdin);
    
    input ();
    solve ();
    
    printf ("%d\n", ans);
    
    return 0;    
}
