#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long l, w;
  cin >> n >> l >> w;
  vector<int> pp, pn;
  vector<int> pp2, pn2;
  while (n--) {
    int temp, pos;
    cin >> temp >> pos;
    if (pos == -1) {
      if (temp > -l)
        pn.push_back(temp);
      else
        pn2.push_back(-temp - l);
    } else {
      if (temp < 0)
        pp.push_back(-temp - l);
      else
        pp2.push_back(temp);
    }
  }
  if (pp.size() == 0 || pn.size() == 0) {
    cout << "0\n";
    return 0;
  }
  sort(pn.begin(), pn.end());
  sort(pp.begin(), pp.end());
  sort(pn2.begin(), pn2.end());
  sort(pp2.begin(), pp2.end());
  int i = 0, j = 0;
  long long ans = pn.size() * pp.size();
  while (i < pp2.size() && j < pn.size()) {
    if (pn[j] + pp2[i] + l >= (pn[j] - pp2[i] + l) * w) {
      j++;
    } else {
      ans += pn.size() - j;
      i++;
    }
  }
  i = 0;
  j = 0;
  swap(pp2, pn2);
  swap(pp, pn);
  while (i < pp2.size() && j < pn.size()) {
    if (pn[j] + pp2[i] + l >= (pn[j] - pp2[i] + l) * w) {
      j++;
    } else {
      ans += pn.size() - j;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
