#include <bits/stdc++.h>
using namespace std;
int n, cont, num, pos;
long long ans;
pair<long double, int> v[100005];
long double l, wmax, val1, val2;
int main() {
  cin >> n >> l >> wmax;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    if (v[i].first + l > 0 && v[i].second == -1) num++;
  }
  sort(v, v + n);
  for (int i = 0; i < n; i++)
    if (v[i].first + l <= 0 && v[i].second == -1) cont++;
  val1 = (-wmax - 1.0) / (1.0 - wmax);
  val2 = (wmax - 1.0) / (1.0 + wmax);
  int i;
  for (i = 0; i < n && v[i].first < 0; i++) {
    while (pos < n && (v[pos].first + l) <= 0 &&
           (pos <= i || v[i].first >= val1 * (v[pos].first + l) || wmax == 1 ||
            v[pos].second != -1)) {
      if (v[pos].second == -1) cont--;
      pos++;
    }
    if (v[i].second == 1) {
      ans += cont + num;
    }
  }
  while (pos < n && (v[pos].first + l) <= 0) pos++;
  for (i; i < n; i++) {
    while (pos < n && (pos <= i || v[i].first >= val2 * (v[pos].first + l) ||
                       wmax == 1 || v[pos].second != -1)) {
      if (v[pos].second == -1) num--;
      pos++;
    }
    if (v[i].second == 1) {
      ans += num;
    }
  }
  cout << ans << endl;
  return 0;
}
