#include <bits/stdc++.h>
using namespace std;
struct node {
  int x;
  int y;
} red[110], blue[110];
bool re[110], bl[110];
bool cmp(node a, node b) {
  if (a.x == b.x)
    return a.y < b.y;
  else
    return a.x < b.x;
}
int main() {
  int n, a, b, ans = 0;
  scanf("%d", &n);
  memset(re, false, sizeof(re));
  memset(bl, false, sizeof(bl));
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    red[i].x = a;
    red[i].y = b;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    blue[i].x = a;
    blue[i].y = b;
  }
  sort(red, red + n, cmp);
  sort(blue, blue + n, cmp);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (red[i].x < blue[i].x && red[i].y < blue[i].y) {
        ans++;
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
