#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, l, w;
  cin >> n >> l >> w;
  vector<long long> x, y;
  for (int i = 0; i < (int)(n); ++i) {
    long long a, b;
    cin >> a >> b;
    if (b == 1) {
      y.push_back(a);
    } else {
      x.push_back(a);
    }
  }
  long long ans = 0;
  int flag = -1;
  vector<pair<long long, long long> > u, v;
  int s = 0, t = 0;
  for (int i = 0; i < (int)((int)(x).size()); ++i) {
    if (x[i] >= 0) {
      u.push_back(pair<long long, long long>(x[i] + l, w + 1));
      s++;
    } else if (x[i] + l <= 0) {
      if (w != 1) {
        v.push_back(pair<long long, long long>(-x[i] - l, w - 1));
      }
    } else {
      flag = 0;
    }
  }
  sort((u).begin(), (u).end(),
       [&](pair<long long, long long> a, pair<long long, long long> b) {
         return a.first * b.second < a.second * b.first;
       });
  sort((v).begin(), (v).end(),
       [&](pair<long long, long long> a, pair<long long, long long> b) {
         return a.first * b.second < a.second * b.first;
       });
  for (int i = 0; i < (int)((int)(y).size()); ++i) {
    if (y[i] >= 0) {
      if (w != 1) {
        ans +=
            (int)(u).size() -
            (int)(upper_bound((u).begin(), (u).end(),
                              pair<long long, long long>(y[i], w - 1),
                              [&](pair<long long, long long> a,
                                  pair<long long, long long> b) {
                                return a.first * b.second < a.second * b.first;
                              }) -
                  u.begin());
      }
    } else if (y[i] + l <= 0) {
      ans += (int)(lower_bound((v).begin(), (v).end(),
                               pair<long long, long long>(-y[i], w + 1),
                               [&](pair<long long, long long> a,
                                   pair<long long, long long> b) {
                                 return a.first * b.second < a.second * b.first;
                               }) -
                   v.begin());
      ans += (int)(u).size();
      t++;
    } else {
      flag = 1;
    }
  }
  if (flag == 0) {
    ans += t;
  } else if (flag == 1) {
    ans += s;
  }
  cout << ans << "\n";
  return 0;
}
