#include <bits/stdc++.h>
using namespace std;
struct a {
  int x, y;
};
int f(a ab, a b) {
  if (ab.x != b.x) return ab.x < b.x;
  return ab.y < b.y;
}
int g(a ab, a b) {
  if (ab.y != b.y) return ab.y < b.y;
  return ab.x < b.x;
}
int h(a ab, a b) {
  if ((ab.y + 1) * (ab.x + 1) != (b.x + 1) * (1 + b.y))
    return (ab.y + 1) * (ab.x + 1) < (b.x + 1) * (1 + b.y);
  if (ab.x != b.x) return ab.x < b.x;
  return ab.y < b.y;
}
a re[1000];
a bl[1000];
int main() {
  int i, n, j, sum = 0, su = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &re[i].x, &re[i].y);
  }
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &bl[i].x, &bl[i].y);
  }
  sort(re + 1, re + 1 + n, f);
  sort(bl + 1, bl + 1 + n, f);
  for (i = n; i >= 1; i--) {
    for (j = n; j >= 1; j--) {
      if (re[j].x < bl[i].x && re[j].y < bl[i].y) {
        sum++;
        re[j].x += 1;
        re[j].x *= 1000;
        break;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (re[i].x >= 1000) {
      re[i].x /= 1000;
      re[i].x -= 1;
    }
  }
  sort(re + 1, re + 1 + n, g);
  sort(bl + 1, bl + 1 + n, g);
  for (i = n; i >= 1; i--) {
    for (j = n; j >= 1; j--) {
      if (re[j].x < bl[i].x && re[j].y < bl[i].y) {
        su++;
        re[j].x += 1;
        re[j].x *= 1000;
        break;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (re[i].x >= 1000) {
      re[i].x /= 1000;
      re[i].x -= 1;
    }
  }
  sum = sum > su ? sum : su;
  su = 0;
  sort(re + 1, re + 1 + n, h);
  sort(bl + 1, bl + 1 + n, h);
  for (i = n; i >= 1; i--) {
    for (j = n; j >= 1; j--) {
      if (re[j].x < bl[i].x && re[j].y < bl[i].y) {
        su++;
        re[j].x += 1;
        re[j].x *= 1000;
        break;
      }
    }
  }
  sum = sum > su ? sum : su;
  printf("%d", sum);
}
