#include <bits/stdc++.h>
using namespace std;
int n, l, maxw;
vector<int> rights, lefts;
long long res;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> l >> maxw;
  for (int i = 0; i < (n); i++) {
    int x, dir;
    cin >> x >> dir;
    if (dir == -1)
      lefts.push_back(x);
    else
      rights.push_back(x);
  }
  sort((lefts).begin(), (lefts).end());
  sort((rights).begin(), (rights).end());
  for (const int x : rights) {
    if (x >= 0)
      res += (lefts.end() -
              upper_bound(
                  (lefts).begin(), (lefts).end(),
                  (int)floor((long double)x / (maxw - 1) +
                             (long double)x / (1 - (long double)1 / maxw)) -
                      l));
    else if (x >= -l)
      res += (lefts.end() - lower_bound((lefts).begin(), (lefts).end(), x));
    else
      res += (lefts.end() -
              upper_bound(
                  (lefts).begin(), (lefts).end(),
                  (int)floor((long double)-x / (maxw + 1) +
                             (long double)x / (1 + (long double)1 / maxw)) -
                      l));
  }
  cout << res << endl;
}
