#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
long long die = 0;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const long long N = 1e6 + 5;
long long n, len, mx;
long long p1[N], p2[N];
long long t1 = 0, t2 = 0;
long long ans = 0;
void sol1() {
  sort(p1 + 1, p1 + 1 + t1), sort(p2 + 1, p2 + 1 + t2);
  long long j = 1;
  for (long long i = (1); i <= (t1); i++) {
    while (j <= t2 && p1[i] > p2[j]) j++;
    if (j > t2) break;
    while (j <= t2 &&
           abs(p1[i] + p2[j] + len) >= abs(p2[j] - p1[i] + len) * mx) {
      j++;
    }
    if (j > t2) break;
    ans += t2 - j + 1;
  }
  cout << ans;
}
void rd() {
  n = read(), len = read(), mx = read();
  for (long long i = (1); i <= (n); i++) {
    long long x, v;
    x = read(), v = read();
    if (v == 1)
      p1[++t1] = x;
    else
      p2[++t2] = x;
  }
}
signed main() {
  rd();
  sol1();
}
