#include <bits/stdc++.h>
using namespace std;
int x1[100005], x2[100005], s1, s2, s;
long long ans = 0;
int main() {
  int n, l, w, x, y;
  scanf("%d%d%d", &n, &l, &w);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    if (y == 1)
      x1[s1++] = x;
    else
      x2[s2++] = x;
  }
  sort(x1, x1 + s1);
  sort(x2, x2 + s2);
  for (int i = 0; i < s1; i++) {
    while (s < s2 && (x2[s] < x1[i] || (fabs((x2[s] + x1[i] + l) / 2.0) >=
                                        0.5 * w * (x2[s] - x1[i] + l))))
      s++;
    ans += s2 - s;
  }
  printf("%I64d", ans);
  return 0;
}
