#include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct node
{
    int x,y;
}r[105],b[105];
int n;
bool cmp(node x, node y)
{
    if(x.x==y.x)
        return x.y<y.y;
    return x.x<y.x;
}
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>r[i].x>>r[i].y;
    for(int i=0;i<n;i++)
        cin>>b[i].x>>b[i].y;
    sort(r,r+n,cmp);
    sort(b,b+n,cmp);
    int c[105];
    memset(c,0,sizeof(c));
    int ans=0;
    for(int i=0;i<n;i++)
    {
        int max1=-1;int z=-1;
        for(int j=0;j<n;j++)
        {
            if(!c[j]&&r[j].x<b[i].x&&r[j].y<b[i].y&&r[j].y>max1)
            {
                max1=r[j].y;
                z=j;
            }

        }
        if(max1!=-1)
        {
            c[z]=1;
            ans++;
    }

    }
    cout<<ans<<endl;
    return 0;
}
