#include <bits/stdc++.h>
using namespace std;
inline char read() {
  static const int IN_LEN = 1000000;
  static char buf[IN_LEN], *s, *t;
  return (s == t               ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin),
          (s == t ? -1 : *s++) : *s++);
}
template <class T>
inline void read(T &x) {
  static bool iosig;
  static char c;
  for (iosig = false, c = read(); !isdigit(c); c = read()) {
    if (c == '-') iosig = true;
    if (c == -1) return;
  }
  for (x = 0; isdigit(c); c = read()) x = ((x + (x << 2)) << 1) + (c ^ '0');
  if (iosig) x = -x;
}
const int OUT_LEN = 10000000;
char obuf[OUT_LEN], *ooh = obuf;
inline void print(char c) {
  if (ooh == obuf + OUT_LEN) fwrite(obuf, 1, OUT_LEN, stdout), ooh = obuf;
  *ooh++ = c;
}
template <class T>
inline void print(T x) {
  static int buf[30], cnt;
  if (x == 0)
    print('0');
  else {
    if (x < 0) print('-'), x = -x;
    for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 + 48;
    while (cnt) print((char)buf[cnt--]);
  }
}
inline void flush() { fwrite(obuf, 1, ooh - obuf, stdout); }
const int N = 100005;
int n, l, w;
long long ans;
pair<int, int> a[N];
inline void solve(pair<int, int> *x, int n) {
  queue<long long> q;
  int tot = 0;
  for (int i = (n); i >= (1); --i)
    if (x[i].second == 1) {
      while (!q.empty() && q.front() > (long long)(w + 1) * x[i].first)
        q.pop(), ++tot;
      ans += tot;
    } else
      q.push((long long)(w - 1) * (x[i].first + l));
}
int main() {
  read(n), read(l), read(w);
  for (int i = (1); i <= (n); ++i) read(a[i].first), read(a[i].second);
  sort(a + 1, a + n + 1);
  for (int i = (1); i <= (n); ++i)
    if (-l < a[i].first && a[i].first < 0) {
      if (a[i].second == 1)
        for (int j = (i + 1); j <= (n); ++j)
          if (a[j].second == -1) ++ans;
      if (a[i].second == -1)
        for (int j = (1); j <= (i - 1); ++j)
          if (a[j].second == 1) ++ans;
      for (int j = (i); j < (n); ++j) a[j] = a[j + 1];
      --n;
      break;
    }
  int mid = 1;
  while (a[mid].first < 0) ++mid;
  int tot = 0;
  for (int i = (1); i < (mid); ++i)
    if (a[i].second == 1) ++tot;
  for (int i = (mid); i <= (n); ++i)
    if (a[i].second == -1) ans += tot;
  solve(a + mid - 1, n - mid + 1);
  for (int i = (1); i < (mid); ++i)
    a[i].first = -a[i].first - l, a[i].second = -a[i].second;
  sort(a + 1, a + mid);
  solve(a, mid - 1);
  printf("%lld", ans);
  return 0;
}
