#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 1e5 + 1;
vector<pair<int, int> > clouds;
vector<int> match;
int L, wmax;
int intersect(int xl, int xr) {
  long double w = 0;
  if (xl >= 0) {
    w = (long double)2 * abs(xr + L) / (abs(xr + L) - abs(xl)) - 1;
  } else if (xr + L <= 0) {
    w = (long double)2 * abs(xl) / (abs(xl) - abs(xr + L)) - 1;
  }
  return w + EPS > wmax ? -1 : 0;
}
int solve(int start) {
  int ileft = upper_bound(match.begin(), match.end(), start) - match.begin();
  int iright = match.size() - 1;
  if (ileft > iright) return 0;
  int left, first, second, right;
  first = 0;
  second = -1;
  left = ileft;
  right = iright;
  while (left <= right) {
    first = (left + right) / 2;
    if (intersect(start, match[first]) == -1) {
      left = first + 1;
    } else {
      right = first - 1;
    }
  }
  if (intersect(start, match[first]) == -1) first++;
  left = ileft;
  right = iright;
  while (left <= right) {
    second = (left + right) / 2;
    if (intersect(start, match[second]) == 1) {
      right = second - 1;
    } else {
      left = second + 1;
    }
  }
  if (intersect(start, match[second]) == 1) second--;
  assert(second - first + 1 >= 0);
  return second - first + 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int n;
  cin >> n >> L >> wmax;
  int x, v;
  for (int i = 0; i < n; i++) {
    cin >> x >> v;
    clouds.push_back(pair<int, int>(x, v));
  }
  sort(clouds.begin(), clouds.end());
  for (const pair<int, int>& it : clouds) {
    if (it.second == -1) match.push_back(it.first);
  }
  long long ans = 0;
  for (const pair<int, int>& it : clouds) {
    if (it.second == 1) ans += solve(it.first);
  }
  cout << ans << nl;
  return 0;
}
