#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int a[maxn], b[maxn];
int main() {
  int n, l, w;
  scanf("%d%d%d", &n, &l, &w);
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (y == 1) {
      a[++cnt1] = x;
    }
    if (y == -1) {
      b[++cnt2] = x;
    }
  }
  sort(a + 1, a + 1 + cnt1);
  sort(b + 1, b + 1 + cnt2);
  long long ans = 0;
  for (int i = 1, j = 1; i <= cnt1; i++) {
    for (; j <= cnt2; ++j) {
      if (a[i] > b[j]) continue;
      double pos = (b[j] - a[i] + (double)l) / 2;
      double x = pos + a[i];
      if (x < 0) x = -x;
      if (pos * w > x) break;
    }
    if (j > cnt2) break;
    ans += cnt2 - j + 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
