#include <bits/stdc++/h>
using namespace std;
typedef struct node
{
        int x,y,colour;
        bool operator < (const struct node t) const
        {
                return y<t.y;
        }
}NODE,*PNODE;
list<NODE> redlist;
NODE a[201];
int main()
{
        int n,m,i,j;
        scanf("%d",&n);
        for(i=0;i<2*n;i++)
        {
                scanf("%d %d",&a[i].x,&a[i].y);
                if(i<=n)
                        a[i].colour=0;
                else
                        a[i].colour=1;
        }
        sort(a,a+2*n);
        for(i=0;i<2*n;i++)
        {
                if(a[i].colour==0)
                {
                        redlist.insert(lower_bound(redlist.begin(),redlist.end(),a[i]),a[i]);
                }
                else
                {
                        int pos=lower_bound(redlist.bein(),redlist.end(),a[i]);
                        if()
redlist.erase(redlist.begin()+pos-1)
                }
        }

}
