#include <bits/stdc++.h>
const long long N = 1e5 + 10;
using namespace std;
long long n, l, w, a, b;
long long ans;
long long a1[N], a2[N], cnt1, cnt2;
signed main() {
  scanf("%lld %lld %lld", &n, &l, &w);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld %lld", &a, &b);
    if (b == 1)
      a1[++cnt1] = a;
    else
      a2[++cnt2] = a;
  }
  sort(a1 + 1, a1 + 1 + cnt1);
  sort(a2 + 1, a2 + 1 + cnt2);
  for (long long i = 1, j = 1; i <= cnt1; i++) {
    while (j <= cnt2 && abs(a1[i] + a2[j] + l) >= w * (a2[j] - a1[i] + l)) j++;
    ans += cnt2 - j + 1;
  }
  cout << ans << endl;
  return 0;
}
