import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import std.csv;
import std.regex;
import std.math;
import core.time;
import std.ascii;
import std.digest.sha;

void main()
{
	alias P = Tuple!(int, "x", int, "y");
	int n = readln.chomp.to!int;
	P[] reds;
	foreach (i; 0..n) {
		auto ab = readln.chomp.split.map!(to!int);
		reds ~= P(ab.front, ab.back);
	}
	P[] blues;
	foreach (i; 0..n) {
		auto ab = readln.chomp.split.map!(to!int);
		blues ~= P(ab.front, ab.back);
	}
	std.algorithm.sort = reds;
	std.algorithm.sort = blues;
	int ans = 0;
	bool[ulong] done;
	foreach (red; reds) {
		foreach (i, blue; blues) {
			if (red >= blue) {
				continue;
			}
			if (i in done) {
				continue;
			}
			// stderr.writeln(red, " : ", blue);
			++ans;
			done[i] = true;
			break;
		}
	}
	ans.writeln;
}
