var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var N = Number(lines[0]);

    var ab = [];
    for (var i = 1; i - 1 < N; i++) {
        var t = lines[i].split(" ");
        ab.push([t[0], t[1]])
    }

    var cd = [];
    for (var i = N + 1; i - (N + 1) < N; i++) {
        cd.push(lines[i].split(" "));
    }

    var used = Array(N).fill(false);
    var ans = 0;

    for (var i = 0; i < N; i++) {
        var x1 = ab[i][0]; var y1 = ab[i][1]
        var d_min = Infinity;

        for (var j = 0; j < N; j++) {
            var x2 = cd[j][0]; var y2 = cd[j][1];

            if (x1 < x2 && y1 < y2 && used[j] === false) {
                var d = Math.abs(y2 - y1);
                if (d < d_min) { d_min = d; var k = j; }
            }
        }
        if (d_min !== Infinity) { used[k] = true; ans++; }
    }
    console.log(ans);
});