#include <bits/stdc++.h>
using namespace std;
int N, idx = 0;
vector<long> lefties, righties;
long long L, W, ret = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  cin >> N >> L >> W;
  for (int i = 0; i < N; i++) {
    int pos, dir;
    cin >> pos >> dir;
    if (dir == 1)
      righties.push_back(pos);
    else
      lefties.push_back(pos);
  }
  sort(lefties.begin(), lefties.end());
  sort(righties.begin(), righties.end());
  for (int i = 0; i < righties.size(); i++) {
    while (idx < lefties.size() && (lefties[idx] < righties[i] ||
                                    W * (lefties[idx] - righties[i] + L) <=
                                        abs(lefties[idx] + righties[i] + L)))
      idx++;
    ret += lefties.size() - idx;
  }
  cout << ret << '\n';
  return 0;
}
