#include <bits/stdc++.h>
using namespace std;
long long n, k, l, wmax, w, x;
vector<long long> pos, neg;
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
bool ok(long long a, long long b) {
  if (b < a) return false;
  a *= 2;
  b *= 2;
  a += l;
  b += l;
  long long mid = (a + b) / 2;
  long long t2 = b - mid + l;
  ;
  ;
  ;
  mid = abs(mid);
  long long d = t2 * wmax;
  ;
  ;
  ;
  if (d > mid) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> l >> wmax;
  for (long long i = 1; i <= n; i++) {
    cin >> x >> w;
    if (w == 1)
      pos.push_back(x);
    else
      neg.push_back(x);
  }
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  if (neg.size() == 0) {
    cout << "0\n";
    return 0;
  }
  long long ans = 0;
  int left = 0, right = 0;
  for (long long ii = 0; ii < pos.size(); ii++) {
    x = pos[ii];
    int i = 0;
    for (; i + 100 < neg.size(); i += 100) {
      int ok1 = ok(x, neg[i]);
      int ok2 = ok(x, neg[i + 99]);
      if (ok1 && ok2) {
        ans += 100;
      } else if (ok1 || ok2) {
        for (int j = 0; j < 100; j++) ans += ok(x, neg[i + j]);
      }
    }
    for (; i < neg.size(); i++) {
      ;
      ans += ok(x, neg[i]);
      ;
    };
  }
  cout << ans << '\n';
}
