#include <bits/stdc++.h>
using namespace std;
long long n, l, w, cnta, cntb, a[100005], b[100005], ANS;
signed main() {
  scanf("%lld%lld%lld", &n, &l, &w);
  for (long long i = 1; i <= n; i++) {
    long long x, v;
    scanf("%lld%lld", &x, &v);
    if (v == 1)
      a[++cnta] = x;
    else
      b[++cntb] = x;
  }
  sort(a + 1, a + cnta + 1);
  sort(b + 1, b + cntb + 1);
  long long j = 1;
  for (long long i = 1; i <= cnta; i++) {
    while (j <= cntb && abs(a[i] + b[j] + l) >= w * (b[j] - a[i] + l)) j++;
    ANS += cntb - j + 1;
  }
  printf("%lld\n", ANS);
  return 0;
}
