#include <bits/stdc++.h>
using namespace std;
int n, L, wmax;
bool ok(int l1, int r1) {
  long double mdx = (long double)(l1 + r1) / 2, mdy = mdx - l1;
  return mdy > 0 && mdy * (long double)wmax > mdx &&
         mdy * (long double)wmax > -mdx;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> L >> wmax;
  vector<int> tol, tor;
  for (int i = 1; i <= n; i++) {
    int x, v;
    cin >> x >> v;
    v == 1 ? tol.push_back(x) : tor.push_back(x);
  }
  if (!tol.size() || !tor.size()) return cout << 0, 0;
  sort(tol.begin(), tol.end());
  sort(tor.begin(), tor.end());
  long long ans = 0;
  for (int i = 0; i < tol.size(); i++) {
    if (!ok(tol[i], tor.back() + L)) continue;
    int l = 0, r = (int)tor.size() - 1;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (ok(tol[i], tor[mid] + L))
        r = mid;
      else
        l = mid + 1;
    }
    ans += (int)tor.size() - r;
  }
  cout << ans << endl;
  return 0;
}
