#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1e5 + 123;
using ll = long long;
vector<ll> forw, backw;
ll len, wmax;
bool can(ll xi, ll xj) {
  ll top = abs(xj + xi + len);
  ll bot = wmax * (xj - xi + len);
  return bot > top;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n >> len >> wmax;
  for (int i = 0; i < n; i++) {
    ll pos, dir;
    cin >> pos >> dir;
    (dir == 1 ? forw : backw).push_back(pos);
  }
  sort(forw.begin(), forw.end());
  sort(backw.begin(), backw.end());
  ll ans = 0;
  for (int u : forw) {
    int fs_idx =
        lower_bound(backw.begin(), backw.end(), u + len) - backw.begin();
    if (fs_idx == backw.size() or not can(u, backw.back())) continue;
    int le = fs_idx - 1, rg = backw.size();
    while (rg - le > 1) {
      int mid = (le + rg) / 2;
      if (can(u, backw[mid]))
        rg = mid;
      else
        le = mid;
    }
    ll add = backw.size() - rg;
    ans += add;
  }
  cout << ans << endl;
  return 0;
}
