#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const double PI = 3.14159265358979;
char t[(100)][(100)];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, l, w;
  cin >> n >> l >> w;
  vector<int> v1;
  vector<double> v2;
  for (int i = 0; i < n; ++i) {
    int x, dir;
    cin >> x >> dir;
    if (dir == 1)
      v1.push_back(x);
    else
      v2.push_back(x);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  long long res = 0;
  for (int x : v1) {
    if (x < 0 && x + l > 0) {
      res += (long long)(v2.end() - lower_bound(v2.begin(), v2.end(), 0));
    } else if (x + l <= 0) {
      double s1 = abs(x);
      double s2 = (double)(w - 1) / (double)(w + 1) * s1;
      res += (long long)(v2.end() -
                         upper_bound(v2.begin(), v2.end(), -s2 - (double)l));
    } else {
      double s1 = x;
      if (w == 1) continue;
      double s2 = (double)(w + 1) / (double)(w - 1) * s1;
      res += (long long)(v2.end() -
                         upper_bound(v2.begin(), v2.end(), s2 - (double)l));
    }
  }
  cout << res;
}
