#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, max, count;
  max = 0;
  pair<int, int> a[101], b[101];
  int A[101];
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d %d", &a[i].first, &a[i].second);
  for (int i = 0; i < N; i++) scanf("%d %d", &b[i].first, &b[i].second);
  for (int i = 0; i < N; i++) {
    A[i] = i;
  }
  do {
    count = 0;
    for (int i = 0; i < N; i++) {
      if (a[i].first < b[A[i]].first && a[i].second < b[A[i]].second) count++;
    }
    if (max < count) max = count;
  } while (next_permutation(A, A + N));
  printf("%d", max);
}
