#include <bits/stdc++.h>
using namespace std;
const long long MAX = 200005, inf = 1e9, mod = 1e9 + 7;
void maxx(long long &a, long long b) {
  if (b > a) a = b;
}
void minn(long long &a, long long b) {
  if (b < a) a = b;
}
using ll = long long;
struct ps {
  long long x, y;
  ps() {}
  ps(long long a, long long b) {
    if (b > 0) {
      x = a;
      y = b;
    } else {
      x = -a;
      y = -b;
    }
  }
  bool operator<(const ps &o) const { return x * o.y < y * o.x; }
  bool operator==(const ps &o) const { return x * o.y == y * o.x; }
};
using ii = pair<ps, long long>;
ii a[MAX];
ii b[MAX];
long long F[MAX];
long long get(long long id) {
  long long res = 0;
  for (; id > 0; id -= id & -id) res += F[id];
  return res;
}
void upd(long long id) {
  for (; id < MAX; id += id & -id) F[id]++;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, d;
  cin >> n >> d;
  vector<ii> vec;
  map<ps, long long> mp;
  for (long long i = 1, x, y; i <= n; i++) {
    cin >> x >> y;
    a[i].first = ps(y + d, x);
    b[i] = ii(ps(y - d, -x), i);
  }
  sort(b + 1, b + 1 + n);
  b[0].first = ps(-1, 0);
  long long N = 0;
  for (long long i = 1; i <= n; i++)
    if (b[i].first == b[i - 1].first)
      a[b[i].second].second = N;
    else
      a[b[i].second].second = ++N;
  sort(a + 1, a + 1 + n);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += get(a[i].second);
    upd(a[i].second);
  }
  cout << ans;
}
