#include <iostream>
#include <algorithm>
#include <cstring>
const int maxn = 205;
using namespace std;

struct node
{
    int x;
    int y;
}a[maxn],b[maxn];
bool cmp(node a,node b)
{
    if(a.x==b.x)
        return a.y<b.y;
    return a.x<b.x;
}
int main()
{
    int n;
    int p;
    int ans=0;
    int vis[maxn];
    memset(vis,0,sizeof(vis));
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i].x>>a[i].y;
    for(int i=1;i<=n;i++)
        cin>>b[i].x>>b[i].y;
    sort(a+1,a+1+n,cmp);
    sort(b+1,b+1+n,cmp);
    for(int i=1;i<=n;i++)
    {
        p=0;
        int f=0;
        for(int j=1;j<=n;j++)
        {
            if(a[j].x<b[i].x&&a[j].y<b[i].y&&!vis[j])
            {
                f++;
                if(f==1)
                {
                    p=j;
                }
                else if(a[j].y>a[p].y)
                {
                    p=j;
                }
            }
        }
        if(p>0)
        {
            vis[p]=1;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}
