#include <bits/stdc++.h>
using namespace std;
typedef struct _point {
  int x;
  int y;
} point;
auto cmp = [](const point& a, const point& b) { return a.x * a.y > b.x * b.y; };
auto cmp2 = [](const point& a, const point& b) {
  return a.x * a.y < b.x * b.y;
};
bool inrange(const point& a, const point& b) {
  return ((a.x <= b.x) && (a.y <= b.y));
}
int main(void) {
  int n;
  vector<point> red;
  vector<point> blue;
  bool red_ck[110] = {
      false,
  };
  bool blue_ck[110] = {
      false,
  };
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    point temp;
    cin >> a >> b;
    temp.x = a;
    temp.y = b;
    red.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    int c, d;
    point temp;
    cin >> c >> d;
    temp.x = c;
    temp.y = d;
    blue.push_back(temp);
  }
  sort(red.begin(), red.end(), cmp2);
  sort(blue.begin(), blue.end(), cmp2);
  for (int i = 0; i < red.size(); i++) {
    for (int j = 0; j < blue.size(); j++) {
      if (red_ck[i]) {
        continue;
      }
      if (blue_ck[j]) {
        continue;
      }
      if (inrange(red[i], blue[j])) {
        if ((red_ck[i] || blue_ck[j]) == false) {
          red_ck[i] = true;
          blue_ck[j] = true;
          ans++;
        } else {
        }
      }
    }
  }
  cout << ans;
  return 0;
}
