#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int n, L, W;
vector<int> pos, neg;
int main() {
  scanf("%d %d %d", &n, &L, &W);
  pos.clear();
  neg.clear();
  for (int k = 0; k < n; ++k) {
    int x, v;
    scanf("%d %d", &x, &v);
    if (v > 0)
      pos.push_back(x);
    else
      neg.push_back(x);
  }
  sort(neg.begin(), neg.end());
  long long ans = 0;
  for (int k = 0; k < pos.size(); ++k) {
    double tmp = pos[k];
    if (W > 1) {
      if (tmp > 0)
        tmp *= (W + 1.0) / (W - 1.0);
      else
        tmp *= (W - 1.0) / (W + 1.0);
      double valid = max(tmp - L, pos[k] * 1.0);
      int num = lower_bound(neg.begin(), neg.end(), valid) - neg.begin();
      while (num < neg.size() && neg[num] - valid < eps) ++num;
      ans += neg.size() - num;
    } else if (pos[k] < 0) {
      int num = upper_bound(neg.begin(), neg.end(), -L) - neg.begin();
      ans += neg.size() - num;
    }
  }
  cout << ans << endl;
  return 0;
}
