#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100000 + 5, inf = 9e17;
long long ans;
vector<long long> v[2];
long long l, r, mid, n, len, wmax;
inline long long check(long long x1, long long x2) {
  long long x = x1 + x2, y = x2 - x1;
  return y * wmax > x && y * wmax > -x;
}
int main() {
  cin >> n >> len >> wmax;
  long long x, y;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    if (y == -1)
      v[0].push_back(x);
    else
      v[1].push_back(x);
  }
  sort(v[0].begin(), v[0].end());
  if (!v[0].size()) {
    cout << "0\n";
    return 0;
  }
  for (int i = 0; i < v[1].size(); i++) {
    l = 0, r = v[0].size();
    while (l < r) {
      mid = (l + r) / 2;
      if (check(v[1][i], v[0][mid] + len))
        r = mid;
      else
        l = mid + 1;
    }
    ans += v[0].size() - r;
  }
  cout << ans << "\n";
  return 0;
}
