#include <bits/stdc++.h>
using namespace std;
int N;
int field[101][101];
int main() {
  cin >> N;
  for (int i = 0; i < 2 * N; ++i) {
    for (int j = 0; j < 2 * N; ++j) {
      field[i][j] = 0;
    }
  }
  for (int i = 0; i < N; ++i) {
    int x, y;
    cin >> x >> y;
    field[x][y] = 1;
  }
  for (int i = 0; i < N; ++i) {
    int x, y;
    cin >> x >> y;
    field[x][y] = 2;
  }
  int cnt = 0;
  for (int i = 2 * N - 1; i >= 0; --i) {
    for (int j = 2 * N - 1; j >= 0; --j) {
      bool flag = true;
      if (field[i][j] == 1) {
        for (int k = 2 * N - 1; k > i; --k) {
          for (int l = 2 * N - 1; l > j; --l) {
            if (field[k][l] == 2) {
              cnt++;
              flag = false;
              field[i][j] = 0;
              field[k][l] = 0;
            }
          }
          if (!flag) break;
        }
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
