#include <bits/stdc++.h>
using namespace std;
int n;
long long l, w;
vector<long long> pos, neg;
bool works(int i, int j) {
  long long x1 = pos[i], x2 = neg[j];
  if (x1 > x2) {
    return false;
  }
  return (x2 - x1 + l) * w > abs(x1 + x2 + l);
}
int main() {
  cin >> n >> l >> w;
  for (int i = 0; i < n; ++i) {
    long long x;
    int v;
    cin >> x >> v;
    if (v == 1) {
      pos.push_back(x);
    } else {
      neg.push_back(x);
    }
  }
  sort(begin(pos), end(pos));
  sort(begin(neg), end(neg));
  int i = 0, j = 0;
  long long ans = 0;
  while (i < ((int)(pos).size())) {
    while (j < ((int)(neg).size()) && !works(i, j)) {
      ++j;
    }
    ans += 1LL * (((int)(neg).size()) - j);
    ++i;
  }
  cout << ans << "\n";
}
