#include <bits/stdc++.h>
using namespace std;
int arr[100005], brr[100005];
int main() {
  int n, l, v;
  cin >> n >> l >> v;
  int k = 0, p = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (b == 1) {
      arr[k++] = a;
    } else {
      brr[p++] = a;
    }
  }
  sort(arr, arr + k);
  sort(brr, brr + p);
  int j = 0;
  long long int ans = 0;
  for (int i = 0; i < k; i++) {
    for (; j < p; j++) {
      if (arr[i] > brr[j]) {
        continue;
      }
      double dis = brr[j] - arr[i] + l;
      double tt = dis / 2;
      double x = arr[i] + tt;
      if (x < 0) {
        x = -x;
      }
      if (tt * v > x) {
        break;
      } else {
        continue;
      }
    }
    if (j > p) {
      break;
    }
    ans += (p - j);
  }
  cout << ans << endl;
  return 0;
}
