#include <bits/stdc++.h>
using namespace std;
vector<int> a, b;
int n, l, w;
long long Ans;
int main() {
  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)
      a.push_back(x);
    else
      b.push_back(x);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int d1 = 0, d2 = 0, d3 = 0;
  for (auto i : a)
    if (i < 0) ++d1;
  for (auto i : b)
    if (i + l > 0) ++d2;
  Ans += 1ll * d1 * d2;
  if (w > 1) {
    int lim = 0;
    for (; lim < b.size() && b[lim] + l <= 0; ++lim)
      ;
    for (auto i : a)
      if (i + l < 0) {
        int l = -1, r = lim;
        while (r - l > 1) {
          int mid = l + r >> 1;
          if (b[mid] < i) {
            l = mid;
            continue;
          }
          double t = 1.0 * (b[mid] + ::l - i) / 2;
          if (-w * t < i + t)
            r = mid;
          else
            l = mid;
        }
        Ans += lim - r;
      }
    for (auto i : a)
      if (i >= 0) {
        int l = lim - 1, r = b.size();
        while (r - l > 1) {
          int mid = l + r >> 1;
          if (b[mid] < i) {
            l = mid;
            continue;
          }
          double t = 1.0 * (b[mid] + ::l - i) / 2;
          if (w * t > i + t)
            r = mid;
          else
            l = mid;
        }
        Ans += b.size() - r;
      }
  }
  printf("%lld\n", Ans);
  return 0;
}
