#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, l, w, x, y;
  vector<long long> v1, v2;
  cin >> n >> l >> w;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y;
    if (y == 1)
      v1.push_back(x);
    else
      v2.push_back(x + l);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  long long p = 0, sz = v2.size();
  long long ans = 0;
  for (auto &i : v1) {
    while (p < sz && abs(i + v2[p]) >= w * (v2[p] - i)) p++;
    ans += sz - p;
  }
  cout << ans;
  return 0;
}
