#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll, ll>
#define x first
#define y second

ii a[101], b[101];
ll n, ans = 0;
bool used[101];

bool ss(ii a, ii b){
    return (b.y > a.y);
}

int main(){
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y;
    for (int i = 0; i < n; i++) cin >> b[i].x >> b[i].y;
    sort(a, a+n, greater<ii>());
    sort(b, b+n, ss);
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            if (a[i].x < b[j].x && a[i].y < b[j].y && !used[j]){
                ans++;
                used[j] = true;
                break;
            }
        }
    }
    cout << ans;
}