#include <iostream>
#include <algorithm>

using namespace std;

class Dot
{
public:
    int x,y;
    bool g;
    Dot(){
        g=false;
    }
    ~Dot(){}
}arr[105],brr[105];

bool cmp(Dot p,Dot q)
{
    if ( (p.x+p.y)==(q.x+q.y) )
            return p.x<q.x;
    else
        return (p.x+p.y)<(q.x+q.y);
}

int main()
{
    int n,i,j,cnt=0;
    cin >> n;
    for (i=0;i<n;i++)
        cin >> arr[i].x >> arr[i].y;
    for (i=0;i<n;i++)
        cin >> brr[i].x >> brr[i].y;
    sort(arr,arr+n,cmp);
    sort(brr,brr+n,cmp);
    for (j=0;j<n;j++)
        for (i=n-1;i>=0;i--)
    {
        if ( arr[i].g==true )
            continue;
        if ( arr[i].x+arr[i].y >= brr[j].x+brr[j].y )
            continue;
        if ( arr[i].x<brr[j].x && arr[i].x<brr[j].y )
        {
            arr[i].g= true;
            brr[j].g= true;
            break;
        }
    }
    for (i=0;i<n;i++)
        if (brr[i].g)
            cnt++;
    cout << cnt << endl;
    return 0;
}
