#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

struct edge { int to, rev; long long cap; };

bool vis[809]; vector<edge>g[809]; int V, inf = 1000000007;

void add_edge(int v1, int v2, long long cost) {
	g[v1].push_back(edge{ v2, (int)g[v2].size(), cost });
	g[v2].push_back(edge{ v1, (int)g[v1].size() - 1, 0LL });
}
long long find_augment(int pos, int tar, long long curflow) {
	if (pos == tar) return curflow;
	vis[pos] = true;
	for (edge &e : g[pos]) {
		if (!vis[e.to] && e.cap > 0) {
			long long newflow = find_augment(e.to, tar, min(e.cap, curflow));
			if (newflow > 0) {
				e.cap -= newflow;
				g[e.to][e.rev].cap += newflow;
				return newflow;
			}
		}
	}
	return 0;
}
long long max_flow(int src, int dst) {
	long long ret = 0;
	while (true) {
		fill(vis, vis + V, false);
		long long res = find_augment(src, dst, inf);
		if (res == 0) break;
		ret += res;
	}
	return ret;
}

int N, A, B, a[810], b[810], cnt; vector<int>X, Y;

int main() {
	cin >> N >> A >> B;
	for (int i = 1; i <= N; i++) {
		cin >> a[i] >> b[i];
		if (abs(a[i] - b[i]) <= A || (B <= abs(a[i] - b[i]) && abs(a[i] - b[i]) <= 2 * A)) {
			cnt++;
			continue;
		}
		if (a[i] - b[i] >= 0) X.push_back(a[i] - b[i]);
		else Y.push_back(a[i] - b[i]);
	}
	sort(X.begin(), X.end());
	sort(Y.begin(), Y.end());
	for (int i = 0; i < X.size(); i++) {
		for (int j = 0; j < Y.size(); j++) {
			if (abs(X[i] + Y[j]) <= A || (B <= abs(X[i] + Y[j]) && abs(X[i] + Y[j]) <= 2 * A)) {
				add_edge(i, j + X.size(), 1);
			}
		}
	}
	for (int i = 0; i < X.size(); i++) add_edge(X.size() + Y.size(), i, 1);
	for (int i = 0; i < Y.size(); i++) add_edge(i + X.size(), X.size() + Y.size() + 1, 1);
	V = X.size() + Y.size() + 2;

	int cnt2 = max_flow(X.size() + Y.size(), X.size() + Y.size() + 1);

	cout << cnt + cnt2 << endl;
	return 0;
}
