#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
int n, l, w;
int x[100015], v[100015], cnt_p;
double p[100015];
int main() {
  scanf("%d%d%d", &n, &l, &w);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x[i], &v[i]);
    if (v[i] < 0) p[++cnt_p] = x[i];
  }
  sort(p + 1, p + cnt_p + 1);
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (v[i] > 0) {
      if (x[i] + l <= 0) {
        ans += cnt_p + 1 -
               (upper_bound(p + 1, p + cnt_p + 1,
                            (double)(w - 1) * x[i] / (w + 1) - l) -
                p);
      } else if (x[i] >= 0) {
        if (1 == w) continue;
        ans += cnt_p + 1 -
               (upper_bound(p + 1, p + cnt_p + 1,
                            (double)(w + 1) * x[i] / (w - 1) - l) -
                p);
      } else {
        ans +=
            cnt_p + 1 - (upper_bound(p + 1, p + cnt_p + 1, (double)x[i]) - p);
      }
    }
  }
  return !printf("%lld\n", ans);
  return 0;
}
