#include <bits/stdc++.h>
using namespace std;
long long n, l, vmax;
bool chk(long long x, long long y) {
  if (x > y) {
    return false;
  }
  long double kek = x + y;
  if (kek >= 0) {
    return vmax > (long double)kek / (y - x + 2 * l);
  } else {
    return vmax > (long double)-kek / (y - x + 2 * l);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> l >> vmax;
  vector<long long> a, b;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    if (y == 1) {
      a.push_back(x + l);
    } else {
      b.push_back(x);
    }
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long ans = 0;
  long long p = a.size();
  long long q = b.size();
  if (q == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < p; i++) {
    long long x = a[i];
    long long bst = q - 1;
    if (!chk(x, b[bst])) {
      continue;
    }
    long long l1 = -1, r1 = bst, l2 = bst, r2 = q;
    while (r1 - l1 > 1) {
      long long m = (r1 + l1) / 2;
      if (chk(x, b[m])) {
        r1 = m;
      } else {
        l1 = m;
      }
    }
    while (r2 - l2 > 1) {
      long long m = (r2 + l2) / 2;
      if (chk(x, b[m])) {
        l2 = m;
      } else {
        r2 = m;
      }
    }
    ans += l2 - r1 + 1;
  }
  cout << ans;
}
