#include <bits/stdc++.h>
using namespace std;
vector<long long> pos, neg;
int main() {
  int n, l, w;
  scanf("%d%d%d", &n, &l, &w);
  for (int i = 1; i <= n; i++) {
    int x, v;
    scanf("%d%d", &x, &v);
    if (v == 1)
      pos.push_back(x);
    else
      neg.push_back(x);
  }
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  long long ans = 0;
  int id = 0;
  for (int i = 0; i < pos.size(); i++) {
    while (id != neg.size()) {
      if (neg[id] <= pos[i]) {
        id++;
        continue;
      }
      if ((neg[id] - pos[i] + l) * w > abs(pos[i] + neg[id] + l))
        break;
      else
        id++;
    }
    ans += neg.size() - id;
  }
  cout << ans;
  return 0;
}
