#include <bits/stdc++.h>
using namespace std;
static const int INF = (1<<30)-1;
struct C{ int x; int y; };
bool asc( const C& left, const C& right ) {
  return left.x == right.x ? left.y < right.y : left.x < right.x;
}

int n;
C a[109],b[109];
int main(){
  cin >> n;
  for(int i=0;i<n;i++) cin >> a[i].x >> a[i].y;
  for(int i=0;i<n;i++) cin >> b[i].x >> b[i].y;

  sort(a,a+n,asc);
  sort(b,b+n,asc);

  int ret = 0, j = 0;
  for(int i=0;i<n;i++){
    int ymax = -1,r;
    for(int j=0;j<n;j++){
      if(a[j].x < b[i].x && a[j].y < b[i].y){
        if(ymax < a[j].y){
          ymax = a[j].y;
          r = j;
        }
      }
    }
    if(ymax != -1){
      a[r].x = INF; a[r].y = INF;
      ret++;
    }
  }
  cout << ret << endl;
  return 0;
}
