#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<cmath>
#include<math.h>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<stack>
#include<queue>
#include<sstream>
#include<bitset>
#include<cstdio>
#include<stdio.h>
#include<cstring>
#include <stdio.h>
#include <math.h>
#include <cmath>
#include <unordered_map>
using namespace std;
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
}
void in_out_txt()
{
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
}
bool compare1( const pair<int,int>& x, const pair<int,int>& y )
{
	return (x.first>y.first);
}
bool compare2( const pair<int,int>& x, const pair<int,int>& y )
{
	return (x.first<y.first);
}
unsigned int mod(unsigned int a,int b,int c)
{
	if(b==0)
		return 1;
	if(b%2==0)
	{
		int x=mod(a,b/2,c);
		return c%(x*x);
	}
	return (a%c * mod(a,b-1,c))%c;
}
bool find(int n, int m)
{
	if (n < m) swap(n, m);
	if (m == 0) return false;
	if (n % m == 0) return true;
	int next = (n / m) * m;
	bool f = find(n - next, m);
	//printf("find %d %d: %d\n", n - next, m, f);
	if (!f) return true;
	if (n - next + m < n) return true;
	return false;
}
bool IsPrime(int num)
{
	if(num==1)
		return false;
	for(int i=2;i*i<=num;i++)
		if(num%i==0)
			return false;
	return true;
}
long long factorial(int n)
{
	long long res=1;
	for(int i=n;i>1;i--)
		res*=i;
	return res;
}
long long zeroo(long long num)
{
	stringstream ss;
	ss<<num;
	string str=ss.str();
	for(int i=0;i<str.size();i++)
	{
		if(str[i]=='0')
		{
			str.erase(i,1);
			i--;
		}
	}
	ss.str("");
	ss.str(str);
	ss>>num;
	return num;
}
bool foo(vector<pair<string,int>>mp,int n,string name,int &idx)
{
	for(int i=0;i<n;i++)
	{
		if(mp[i].first == name)
		{
			idx=i;
			return true;
		}
	}
	return false;
}
int chk1(int val)
{
	int base;
	if(val>=1 && val<10)
		base=0;
	if(val>=10 && val<20)
		base=1;
	if(val>=20 && val<30)
		base=2;
	if(val>=30 && val<40)
		base=3;
	if(val>=40 && val<50)
		base=4;
	if(val==50)
		base=5;
	return base;
}
long long GCD(long long a,long long b)
{
	if(a%b==0)
		return b;
	return GCD(b,a%b);
}
bool lucky(int n)
{
	int t=n;
	bool ok=true;
	while(n!=0)
	{
		int rem=n%10;
		if(rem!=4 && rem!=7)
			ok=false;
		n/=10;
	}
	if(ok==true)
		return true;
	else if(t%4==0 || t%7==0 || t%44==0 || t%47==0 || t%74==0 || t%77==0 || t%447==0 || t%474==0  || t%477==0 || t%744==0 || t%747==0 || t%774==0 || t%777==0)
		return true;
	else
		return false;
}
int f91(int n)
{
	int c;
	if(n<=100)
		c=f91(f91(n+11));
	else if(n>=101)
		c=n-10;
	return c;
}
int convertBinaryToDecimal(long long n)
{
	int decimalNumber=0,remainder;
	double i=0;
	while (n!=0)
	{
		remainder=n%10;
		n/=10;
		decimalNumber+=remainder*pow(2.0,i);
		i++;
	}
	return decimalNumber;
}
long long convertDecimalToBinary(int n)
{
	long long binaryNumber=0;
	int remainder,i=1;
	while (n!=0)
	{
		remainder=n%2;
		n/=2;
		binaryNumber+=remainder*i;
		i*=10;
	}
	return binaryNumber;
}
string toBinary(long long n)
{
	string str;
	while(n!=0)
	{
		int rem=n%2;
		char c=rem+'0';
		str=c+str;
		n/=2;
	}
	return str;
}
unsigned long long toDecimal(string n)
{
	long long val=0;
	for(int i=n.size()-1,j=0;i>=0;i--,j++)
	{
		if(n[i]=='1')
			val+=pow(2.0,j);
	}
	return val;
}
unsigned long long pow(long long x,long long y)
{
	unsigned long long res=1;
	for(unsigned long long i=0;i<y;i++)
		res*=x;
	return res;
}
unsigned int calc(unsigned int a,int k,int n)
{
	if (k == 1)
		return a;
	if (k % 2 == 0)
		return calc((a * a) % n, k / 2, n);
	else
		return (a * calc((a * a) % n, k / 2, n)) % n;
}
bool letter(char c)
{
	if((c>='A' && c<='Z') || (c>='a' && c<='z'))
		return true;
	return false;
}
bool check(int x,int y,int n,int m)
{
	if(x>=1 && x<=n && y>=1 && y<=m)
		return true;
	return false;
}
int alg(int n)
{
	if(n==1)return 1;
	if(n%2==0) return 1+(alg(n/2));
	return 1+(alg(3*n+1));
}
int combinatorics(int n,int k)
{
	long long res=factorial(n)/(factorial(k)*factorial(n-k));
	return res;
}
int F(int p)
{
	int cnt=0;
	while(p!=0)
	{
		cnt+=p%10;
		p/=10;
	}
	if(cnt<10)
		return cnt;
	F(cnt);
}
/*
void dfs(int x)
{
	if(vis[x])
		return;
	vis[x]=true;
	for(int i=0;i<v[x].size();i++)
	{
		if(!vis[v[x][i]])
			dfs(v[x][i]);
	}
}
*/

//int mem[1005][1005];
//int arr[1005][1005];
//int dp(int i,int j,int n,int m)
//{
//	if(i>=n || j>=m)
//		return 0;
//	if(i==n-1 && j==m-1)
//		return arr[i][j];
//	if(mem[i][j]!=-1)
//		return mem[i][j];
//	int right=dp(i,j+1,n,m);
//	int down=dp(i+1,j,n,m);
//	return mem[i][j]=arr[i][j]+max(right,down);
//}
//long long res(long long n,long long mid)
//{
//	long long all=0;
//	for(long long i=0;i<n;i++)
//		z[i]=v[i]+(i+1)*(long long)mid;
//	sort(z.begin(),z.end());
//	for(long long i=0;i<mid;i++)
//		all+=z[i];
//	return all;
//}
bool win(char a,char b)
{
	if(a=='R' && b=='S' || a=='S' && b=='P' || a=='P' && b=='R')
		return true;
	return false;
}
void changeTime(string str,int &hour,int &minutes)
{
	if(str[0]=='1')
		hour=(str[0]-'0')*10;
	hour+=str[1]-'0';
	if(str[3]!='0')
		minutes=(str[3]-'0')*10;
	minutes+=str[4]-'0';
}
long long nod(int x)
{
	if(x==1)
		return 1;
	if(IsPrime(x))
		return 2;
	long long cnt=2;
	for(int i=2;i*i<=x;i++)
	{
		if(x%i==0 && x%(x/i)==0 && i!=(x/i))
			cnt+=2;
		else if(x%i==0 && x%(x/i)==0 && i==(x/i))
			cnt++;
	}
	return cnt;
}
int pow(int x,int y)
{
	for(int i=1;i<=y;i++)
		x*=x;
	return x;
}
vector<pair<int,int>>blue,red;
int main()
{
	//in_out_txt();
	fast();
	int n;
	cin>>n;
	red.resize(n);
	blue.resize(n);
	for(int i=0;i<n;i++)
		cin>>red[i].first>>red[i].second;
	for(int i=0;i<n;i++)
		cin>>blue[i].first>>blue[i].second;
	sort(red.begin(),red.end(),compare1);
	sort(blue.begin(),blue.end(),compare2);
	int cnt=0;
	for(int i=0;i<n;i++)
	{
		int I=-1,J=-1,diffX=0,diffY=0;
		for(int j=0;j<n;j++)
		{
			if(red[i].first<blue[j].first && red[i].second<blue[j].second)
			{
				if((diffX==0 && diffY==0) || (blue[j].first-red[i].first<diffX || blue[j].second-red[i].second<diffY))
				{
					diffX=blue[j].first-red[i].first;
					diffY=blue[j].second-red[i].second;
					I=i;
					J=j;
				}
			}
		}
		if(I!=-1 && J!=-1)
		{
			red[I].first=-1;
			red[I].second=-1;
			blue[J].first=-1;
			blue[J].second=-1;
			cnt++;
		}
	}
	cout<<cnt<<'\n';
	//system("pause");
	return 0;
}

Measured memory_bytes: 256