#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
int n, l, w, na, nb;
int a[N], b[N];
inline bool calc(double x, double y) {
  int t = w * y > fabs(x);
  return w * y > fabs(x);
}
inline bool check(int i, int j) {
  if (a[i] > b[j]) return 0;
  double x = (a[i] + b[j] + l) / 2., y = (b[j] - a[i] - l) / 2.;
  int t = calc(x, y) + calc(x - l / 2., y + l / 2.) +
          calc(x + l / 2., y + l / 2.) + calc(x, y + l);
  return t > 0;
}
inline int low(int i, int st, int ed, int o) {
  int res = -1;
  while (st <= ed) {
    int mid = st + ed >> 1;
    if (check(i, mid)) {
      res = mid;
      o ? (ed = mid - 1) : (st = mid + 1);
    } else {
      o ? (st = mid + 1) : (ed = mid - 1);
    }
  }
  return res;
}
inline int low(int i, int st, int ed) {
  int res = -1;
  while (st <= ed) {
    int mid = st + ed >> 1;
    if (check(i, mid)) {
      res = mid;
      ed = mid - 1;
    } else {
      st = mid + 1;
    }
  }
  return res;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> l >> w;
  for (int i = (0); i < (n); i++) {
    int x, y;
    cin >> x >> y;
    if (~y) {
      a[na++] = x;
    } else {
      b[nb++] = x;
    }
  }
  sort(a, na + a);
  sort(b, nb + b);
  long long ans = 0;
  for (int i = (0); i < (na); i++) {
    int p = low(i, 0, nb - 1);
    if (~p) ans += nb - p;
  }
  cout << ans << endl;
  return 0;
}
