#include <bits/stdc++.h>
using namespace std;
int64_t n, l, w, i, j, x, y, a, b, r, A[179000], B[179000];
int main() {
  for (cin >> n >> l >> w; i < n; i++)
    cin >> x >> y, y > 0 ? A[a++] = x : B[b++] = x;
  sort(A, A + a);
  sort(B, B + b);
  for (i = j = 0; i < a; i++) {
    while (j < b && abs(A[i] + B[j] + l) >= w * (B[j] - A[i] + l)) j++;
    r += b - j;
  }
  cout << r;
}
