#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int T, n, m, t1, t2, w, len;
int l[N], r[N];
bool check(int ridx, int lidx) {
  if (l[lidx] < r[ridx]) return false;
  long double X = ((double)r[ridx] + l[lidx] + len) / 2;
  long double Y = X - r[ridx];
  if (X >= 0) {
    return Y > X / w;
  } else {
    return Y > X / -w;
  }
}
int main() {
  scanf("%d %d %d", &n, &len, &w);
  int ri = 0, li = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &t1, &t2);
    if (t2 == 1) {
      r[ri] = t1;
      ++ri;
    } else {
      l[li] = t1;
      ++li;
    }
  }
  sort(l, l + li);
  long long ans = 0;
  for (int i = 0; i < ri; ++i) {
    int le = 0, re = li, mid;
    while (le < re) {
      mid = (le + re) / 2;
      if (check(i, mid)) {
        re = mid;
      } else {
        le = mid + 1;
      }
    }
    ans += li - le;
  }
  printf("%lld\n", ans);
}
