#include <bits/stdc++.h>
using namespace std;
int n, sum;
struct node {
  int a;
  int b;
  bool ok;
} a[105], b[105];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].a >> a[i].b;
  for (int i = 1; i <= n; i++) cin >> b[i].a >> b[i].b;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (a[i].a < b[j].a && a[i].b < b[j].b && !a[i].ok && !b[j].ok) {
        sum++;
        a[i].ok = true;
        b[j].ok = true;
      }
  cout << sum;
  return 0;
}
