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

typedef pair<int, int> P;

int main() {
	int n;
	vector<P>r, b;
	cin >> n;
	r.resize(n);
	b.resize(n);
	for (int i = 0;i < n;i++) {
		cin >> r[i].first >> r[i].second;
	}
	for (int i = 0;i < n;i++) {
		cin >> b[i].first >> b[i].second;
	}
	sort(b.begin(), b.end());
	
	int cnt = 0;
	bool used[100] = {};
	for (int i = 0;i < n;i++) {
		int maxy = -1, use = -1;
		for (int j = 0;j < n;j++) {
			if (!used[j] && b[i].first > r[j].first&&b[i].second > r[j].second) {
				if (r[j].second > maxy) {
					maxy = r[j].second;
					use = j;
				}
			}
		}
		if (use != -1) {
			used[use] = true;
			cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}