#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int SIZE = 105;
int deg[SIZE];
int n, xa[SIZE], ya[SIZE], xb[SIZE], yb[SIZE];
vector<int> path[SIZE];
bool choose1[SIZE], choose2[SIZE];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", xa + i, ya + i);
  for (int i = 0; i < n; i++) scanf("%d%d", xb + i, yb + i);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (xa[i] < xb[j] && ya[i] < yb[j]) {
        path[i].push_back(j);
        ans++;
        deg[j]++;
      }
    }
  }
  for (;;) {
    int MIN = INF;
    int p = -1;
    for (int j = 0; j < n; j++) {
      if (choose1[j]) continue;
      if (MIN > path[j].size()) {
        p = j;
        MIN = path[j].size();
      }
    }
    int i = p;
    if (i == -1) break;
    MIN = INF;
    p = -1;
    choose1[i] = true;
    for (int j = 0; j < path[i].size(); j++) {
      int tmp = path[i][j];
      if (choose2[tmp]) continue;
      if (MIN > deg[tmp]) {
        p = tmp;
        MIN = deg[tmp];
      }
    }
    for (int j = 0; j < path[i].size(); j++) deg[path[i][j]]--;
    if (p == -1) {
      ans -= path[i].size();
      continue;
    }
    choose2[p] = true;
    ans -= path[i].size() - 1;
  }
  for (int i = 0; i < n; i++) {
  }
  printf("%d\n", ans);
  return 0;
}
