#include <bits/stdc++.h>

using namespace std;

#define EPS 1e-9
#define For(i,N) FOR(i,N)
#define Forr(i,a,b) FORR(i,a,b)
#define Fotr(i,a,b,c) FOTR(i,a,b,c)
#define FOR(i,N) FORR(i, 0, N)
#define FORR(i,a,b) FOTR(i, a, b, 1)
#define FOTR(i,a,b,c) for(int i=(a);i<(b);i+=(c))
#define FOREACH(i,x) for(__typeof__((x).begin())i=(x).begin();i!=(x).end();i++)
#define MEM(a,x) memset(a,x,sizeof(a))
#define BCHK(a,x) (((a)>>(x))&1)
#define BSET(a,x) ((a)|(1<<(x)))
#define BCLR(a,x) ((a)&(~(1<<(x))))
#define BTGL(a,x) ((a)^(1<<(x)))
#define FMT(...) (sprintf(CRTBUFF, __VA_ARGS__)?CRTBUFF:0)
#define read() freopen("input.txt","r",stdin)
#define write() freopen("output.txt","w",stdout)
#define cpp_io() {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define BUFFSIZE 30000
#define INF 1000000000
#define MAX 50000
#define MOD 1000000007
#define pb push_back
#define mkpr make_pair
#define pii pair<int, int>
#define PI acos(-1)
#define ll long long
#define fi first
#define si second
#define all(x) x.begin(), x.end()
#define double long double

char CRTBUFF[BUFFSIZE];
#define dbg(args...) {cerr<<"-->";debugger::call(#args,args);cerr<<"\n";}
struct debugger {
    static void call(const char* it) {}
    template<typename T, typename ... aT>
    static void call(const char* it, T a, aT... rest) {
        string b;
        for (; *it&&*it != ','; ++it) if (*it != ' ')b += *it;
        cerr << b << "=" << a << " ";
        call(++it, rest...);
    }
};

struct edge {
    int a, b, cap, flow;
};

struct DINIC {
    int s; // Source
    int t; // Sink
    int d[MAX], ptr[MAX];

    vector<edge> e;
    vector<int> g[MAX];

    void add_edge(int a, int b, int cap) {
        edge e1 = { a, b, cap, 0 };
        edge e2 = { b, a, 0, 0 };

        g[a].push_back(e.size());
        e.push_back(e1);
        g[b].push_back(e.size());
        e.push_back(e2);
    }
    bool bfs() {
        queue<int> q;
        q.push(s);
        memset(d, -1, sizeof(d));
        d[s] = 0;
        while (!q.empty() && d[t] == -1) {
            int v = q.front(); q.pop();
            for (size_t i = 0; i<g[v].size(); ++i) {
                int id = g[v][i],
                    to = e[id].b;
                if (d[to] == -1 && e[id].flow < e[id].cap) {
                    q.push(to);
                    d[to] = d[v] + 1;
                }
            }
        }
        return d[t] != -1;
    }
    int dfs(int v, int flow) {
        if (!flow)  return 0;
        if (v == t)  return flow;
        for (; ptr[v]<g[v].size(); ++ptr[v]) {
            int id = g[v][ptr[v]],
                to = e[id].b;
            if (d[to] != d[v] + 1)  continue;
            int pushed = dfs(to, min(flow, e[id].cap - e[id].flow));
            if (pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }
    ll max_flow() {
        ll flow = 0;
        for (;;) {
            if (!bfs())  break;
            memset(ptr, 0, sizeof(ptr));
            while (int pushed = dfs(s, INF)) {
                flow += pushed;
            }
        }
        return flow;
    }
    void init(int source, int sink) {
        s = source;
        t = sink;
    }
}dinic;

int A[200][2];
int B[200][2];

int main(){
    cpp_io();
    #ifdef LOCAL
        read();
        //write();
    #endif

    int  n;

    cin>>n;

    FOR(i, n)cin>>A[i][0]>>A[i][1];
    FOR(i, n)cin>>B[i][0]>>B[i][1];

    int sr = 10001, sn = 10002;
    dinic.init(sr, sn);

    FOR(i, n){
        dinic.add_edge(sr, i, 1);
        dinic.add_edge(200+i, sn, 1);
        FOR(j, n){
            if(A[i][0] < B[j][0] && A[i][1] < B[j][1])
                dinic.add_edge(i, j+200, 1);
        }
    }
    cout<<dinic.max_flow()<<"\n";
}












Measured memory_bytes: 2048