#include <bits/stdc++.h>
using namespace std;
const int N = 1.1e5;
struct node {
  long long p, v;
  bool operator<(const node &a) const { return p < a.p; }
} a[N], b[N];
long long n, l, mx, sza, szb;
bool check(node x, node y) {
  long long pt = (x.p + y.p + l);
  return (long long)abs(y.p + l - x.p) * mx > abs(pt);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> l >> mx;
  for (long long i = 1, p, v; i <= n; i++) {
    cin >> p >> v;
    if (v == 1)
      a[++sza] = (node){p, v};
    else
      b[++szb] = (node){p, v};
  }
  sort(a + 1, a + 1 + sza);
  sort(b + 1, b + 1 + szb);
  long long cnt = 0;
  for (long long i = 1; i <= sza; i++) {
    node tmp = (node){a[i].p - l, a[i].v};
    long long L = upper_bound(b + 1, b + 1 + szb, tmp) - b, R = szb,
              ans = szb + 1, mid;
    while (L <= R) {
      mid = (L + R) >> 1;
      if (check(a[i], b[mid]))
        ans = mid, R = mid - 1;
      else
        L = mid + 1;
    }
    cnt += szb - ans + 1;
  }
  cout << cnt << endl;
  return 0;
}
