#include <bits/stdc++.h>
using namespace std;
int n, L, W, A[100005], B[100005], t1, t2;
long long ans;
int main() {
  int x, y;
  scanf("%d%d%d", &n, &L, &W);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    if (y == 1)
      A[++t1] = x;
    else
      B[++t2] = x;
  }
  sort(A + 1, A + t1 + 1);
  sort(B + 1, B + t2 + 1);
  for (int i = 1, j = 1; i <= t1; i++) {
    while (j <= t2 && abs(A[i] + B[j] + L) >= 1ll * W * (B[j] - A[i] + L)) j++;
    ans += t2 - j + 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
