#include <bits/stdc++.h>
using namespace std;
int n;
vector<double> xL, xR;
int l, w;
int main() {
  scanf("%d %d %d", &n, &l, &w);
  for (int i = 0; i < n; i++) {
    int x, v;
    scanf("%d %d", &x, &v);
    if (v == +1) xR.push_back(x);
    if (v == -1) xL.push_back(x);
  }
  sort(xL.begin(), xL.end());
  sort(xR.begin(), xR.end());
  unsigned long long res = 0;
  const double INF = 1000000000;
  for (int i = 0; i < xL.size(); i++) {
    double d;
    int currCnt = 0;
    auto b = lower_bound(xR.begin(), xR.end(), -xL[i] - l);
    d = w > 1 ? 1.0 * (xL[i] + l) * (w + 1) / (w - 1)
              : (xL[i] + l > 0 ? INF : -INF);
    currCnt += lower_bound(xR.begin(), b, d) - xR.begin();
    d = 1.0 * (xL[i] + l) * (w - 1) / (w + 1);
    currCnt += lower_bound(b, xR.end(), d) - b;
    res += currCnt;
  }
  cout << res << endl;
  return 0;
}
