#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
inline void II(int &n) {
  char ch = getchar();
  n = 0;
  bool t = 0;
  for (; ch < '0'; ch = getchar())
    if (ch == '-') t = 1;
  for (; ch >= '0'; n = n * 10 + ch - '0', ch = getchar())
    ;
  if (t) n = -n;
}
inline void OO(int a) {
  if (a < 0) {
    putchar('-');
    a = -a;
  }
  if (a >= 10) OO(a / 10);
  putchar(a % 10 + '0');
}
int n, l, w, an, bn;
long double a[200005], b[200005];
int nl1, nl2, nr1, nr2, x, v;
const long double eps = 1e-8;
int sgn(long double x) { return (x > eps) - (x < -eps); }
int main() {
  scanf("%d%d%d", &n, &l, &w);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x, &v);
    if (v == 1) {
      if (x < 0) ++nl1;
      if (x <= 0) ++nl2;
      a[++an] = x;
    }
    if (v == -1) {
      if (x + l > 0) ++nr1;
      if (x + l >= 0) ++nr2;
      b[++bn] = x;
    }
  }
  sort(a + 1, a + 1 + an);
  sort(b + 1, b + 1 + bn);
  long long ans = 0;
  if (w == 1) {
    ans = 1LL * nl1 * nr1;
  } else {
    ans = 1LL * nl2 * nr1 + 1LL * nl1 * (nr2 - nr1);
    for (int i = 1; i <= an; ++i)
      if (a[i] > 0) {
        long double t = 1.0 * a[i] / (1.0 * w - 1);
        long double pos = t * (w + 1);
        int id = upper_bound(b + 1, b + 1 + bn, pos - l + eps) - b;
        ans += bn - id + 1;
      }
    for (int i = 1; i <= bn; ++i)
      if (b[i] + l < 0) {
        long double t = (b[i] + l) / (1.0 * w - 1);
        long double pos = t * (w + 1);
        int id = lower_bound(a + 1, a + 1 + an, pos - eps) - a;
        ans += id - 1;
      }
  }
  cout << ans << endl;
  return 0;
}
