#include <bits/stdc++.h>
int main(void) {
  int N, i = 0, j = 0, k = 0;
  int a[300], b[300], c[300], d[300];
  int count = 0;
  scanf("%d", &N);
  for (; i < N; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (; j < N; j++) {
    scanf("%d %d", &c[j], &d[j]);
  }
  for (; k < N; k++) {
    if (a[k] < c[k] || b[k] < d[k]) {
      count += 1;
    }
  }
  printf("%d\n", count);
  return 0;
}
