#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct Cloud {
  Cloud(int ip, int iv) : pos(ip), vel(iv) {}
  int pos;
  int vel;
  bool operator<(const Cloud& c) const { return pos < c.pos; }
};
int n, l, wmax;
vector<Cloud> clouds;
void Load() {
  scanf("%d%d%d", &n, &l, &wmax);
  for (int i = 0; i < ((int)(n)); ++i) {
    int pos, vel;
    scanf("%d%d", &pos, &vel);
    clouds.push_back({pos, vel});
  }
}
ll CountPairs(const vector<int>& rom_hr, const vector<int>& rom_hl) {
  if (rom_hr.size() == 0 || rom_hl.size() == 0) return 0;
  ll new_pairs = 0;
  for (int x1 : rom_hr) {
    double min_x2 = 2.0 * x1 / (wmax - 1) + x1 - l;
    if (rom_hl.back() <= min_x2) continue;
    int lo = 0, hi = rom_hl.size() - 1;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      if (rom_hl[mid] > min_x2)
        hi = mid;
      else
        lo = mid + 1;
    }
    new_pairs += rom_hl.size() - hi;
  }
  return new_pairs;
}
void Solve() {
  ll ans = 0;
  ll num_lom_hr = 0, num_rom_hl = 0;
  for (int i = 0; i < ((int)(n)); ++i) {
    if (clouds[i].pos <= -l && clouds[i].vel == 1) num_lom_hr++;
    if (clouds[i].pos >= 0 && clouds[i].vel == -1) num_rom_hl++;
  }
  ans += num_lom_hr * num_rom_hl;
  for (int i = 0; i < ((int)(n)); ++i) {
    if (clouds[i].pos >= 0 || clouds[i].pos <= -l) continue;
    ans += clouds[i].vel == 1 ? num_rom_hl : num_lom_hr;
  }
  if (wmax == 1) {
    printf("%lld\n", ans);
    return;
  }
  vector<int> rom_hr, rom_hl;
  for (int i = 0; i < ((int)(n)); ++i) {
    if (clouds[i].pos < 0) continue;
    if (clouds[i].vel == 1)
      rom_hr.push_back(clouds[i].pos);
    else
      rom_hl.push_back(clouds[i].pos);
  }
  sort((rom_hr).begin(), (rom_hr).end());
  sort((rom_hl).begin(), (rom_hl).end());
  ans += CountPairs(rom_hr, rom_hl);
  rom_hr.clear(), rom_hl.clear();
  for (int i = 0; i < ((int)(n)); ++i) {
    if (clouds[i].pos > -l) continue;
    if (clouds[i].vel == -1)
      rom_hr.push_back(-clouds[i].pos - l);
    else
      rom_hl.push_back(-clouds[i].pos - l);
  }
  sort((rom_hr).begin(), (rom_hr).end());
  sort((rom_hl).begin(), (rom_hl).end());
  ans += CountPairs(rom_hr, rom_hl);
  printf("%lld\n", ans);
}
int main() {
  Load();
  Solve();
  return 0;
}
