#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double E = exp(1.0);
const double eps = 1e-30;
const double INFD = 1e20;
const long long INFLL = 0x3f3f3f3f3f3f3f3fll;
const int INF = 0x3f3f3f3f;
const int maxn = (int)1e5 + 10;
const int MAXN = (int)1e2 + 10;
const int MOD = (int)1e9 + 7;
int n, l, w;
int len_a, len_b;
int a[maxn];
int b[maxn];
void RUN() {
  while (cin >> n >> l >> w) {
    len_a = len_b = 0;
    for (int i = 1; i <= n; ++i) {
      int x, v;
      cin >> x >> v;
      if (v == 1) {
        a[++len_a] = x;
      } else if (v == -1) {
        b[++len_b] = x;
      }
    }
    sort(a + 1, a + len_a + 1);
    sort(b + 1, b + len_b + 1);
    long long ans = 0;
    for (int i = 1, j = 1; i <= len_a; ++i) {
      for (; j <= len_b; ++j) {
        if (b[j] < a[i]) continue;
        double temp = (b[j] - a[i] + l) / 2.0;
        double x = fabs(temp + a[i]);
        if (temp * w > x) {
          break;
        }
      }
      if (j > len_b) break;
      ans += len_b - j + 1;
    }
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  RUN();
  return 0;
}
