#include <bits/stdc++.h>
using namespace std;
struct Node {
double bi, en;
};
int n, r, res = 1;
Node a[1005];
bool cmp (Node a, Node b) {
return a.en < b.en;
}
int main () {
freopen("monitor.in","r", stdin);
freopen("monitor.out","w",stdout);
cin >> n >> r;
int r1 = r * r;
int x, y;
for (int i = 1; i <= n; i++) {
cin >> x >> y;
if (y > r) {
cout << -1;
return 0;
}
double m = sqrt(r1 - y * y); a[i].bi = x - m; a[i].en = x + m;
}
sort(a+1, a+1+n, cmp);
double leida = a[1].en;
for (int i = 2; i <= n; i++) {
if (leida < a[i].bi) res++, leida = a[i].en;
}
cout << res << endl;
return 0;
}