#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const long long M = 1e9 + 7;
const long long maxn = 2e5 + 7;
const double pi = acos(-1.0);
const double eps = 0.00000001;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <typename T>
inline T powMM(T a, T b) {
  T ret = 1;
  for (; b; b >>= 1ll, a = (long long)a * a % M)
    if (b & 1) ret = (long long)ret * a % M;
  return ret;
}
int n, l;
long long w;
int i, j;
pair<int, int> c[maxn];
int cnt[maxn];
long long ans;
int main() {
  scanf("%d%d%I64d", &n, &l, &w);
  for (i = 1; i <= n; i++) scanf("%d%d", &c[i].first, &c[i].second);
  sort(c + 1, c + n + 1);
  for (i = 1; i <= n; i++) cnt[i] = cnt[i - 1] + (c[i].second == 1);
  int L = 1;
  for (i = 1; i <= n; i++) {
    if (c[i].second == -1) {
      while (c[L].first * (w - 1) < (c[i].first + l) * (w + 1) &&
             c[L].first * (w + 1) < (c[i].first + l) * (w - 1) && L <= i)
        L++;
      ans += cnt[L - 1];
    }
  }
  printf("%I64d\n", ans);
}
