/*
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;

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);
         A[i].y += 2*MAX_VAL;
     }
}

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

int column (double x)
{
    int i, j, res=0;
    double D, Y0, Y1;
    vector<int> V(0);
    
    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) );
        Y0 = A[i].y + D;
        Y1 = A[i].y - D;
        if (Y0>Y1) swap (Y0,Y1);
        
        V.push_back ( int(floor(Y0+eps)+eps) );
        V.push_back ( int(ceil(Y1-eps)+eps) );       
    }
    
    sort (V.begin(), V.end());
    
    for (i=1; i<V.size(); i++)
        res += (V[i]-V[i-1])*(i&1);
        
    return res;
}

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

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