#include <bits/stdc++.h>

using namespace std;

#ifndef ONLINE_JUDGE
#define pr_debug(...) do { printf("DEBUG: line %d: %s: ", __LINE__, __PRETTY_FUNCTION__); printf(__VA_ARGS__); } while(0)
#define pr_vars(...) do { pr_debug(" "); pr_var(split(#__VA_ARGS__, ',').begin(), __VA_ARGS__); } while(0)
#else
__attribute__ ((constructor)) static void fast_cin() { ios_base::sync_with_stdio(false); cin.tie(0); }
#define pr_debug(...) do { } while(0)
#define pr_vars(...) do { } while(0)
#endif /* ONLINE_JUDGE */

using ll = int64_t;
using ull = uint64_t;
#define X first
#define Y second
#define pb push_back

template<typename T> ostream &operator<< (ostream &fout, const vector<T> &vec)
{ for (size_t i = 0; i < vec.size(); i++) fout << vec[i] << ' '; return fout; }

template<typename T> istream &operator>> (istream &fin, vector<T> &vec)
{ for (size_t i = 0; i < vec.size(); i++) fin >> vec[i]; return fin; }

vector<string> split(const string &s, char c) { vector<string> v; ull st = 0, fn = 0, lvl = 0;
                                                for ( ; fn < s.size(); fn++ ) { if (s[fn] == c && lvl == 0) { v.push_back(s.substr(st, fn - st)); st = fn + 1; }
                                                    if (s[fn] == '(') { lvl++; } if (s[fn] == ')') { lvl--; } } v.push_back(s.substr(st, fn - st)); return v; }

void pr_var(vector<string>::iterator it) { (void) it; cout << endl; }
template<typename T, typename... Args> void pr_var(vector<string>::iterator it, T a, Args... args)
{ cout << *it << "=" << a << "  "; pr_var(++it, args...); }

ll div_ceil(ll n, ll d) { ll res = n / d; if (res >= 0) res += n % d ? 1 : 0; return res; }
ll gcd(ll a, ll b) { a = llabs(a); b = llabs(b); while (a && b) a > b ? a %= b : b %= a; return a + b; }
ll lcm(ll a, ll b) { ll c = gcd(a, b); return c == 0 ? 0 : llabs(a / c * b); }

#define setp(a) fixed << setprecision(a)
const double PI = acos(-1.0);
constexpr double EPS = 1e-9;
constexpr double INF = 2e18;
constexpr ll MOD = 1e9 + 7;

using mp = pair<ll, ll>;
using mt = tuple<ll, ll, ll>;    // unpack: tie(ll, ll, ll) = mt;

constexpr ll MAX = 1e5 + 5;

ll dist(mp p1, mp p2)
{
//    ll xx = p1.X - p2.X;
//    ll yy = p1.Y - p2.Y;
//    return xx * xx + yy * yy;
    //return llabs(p1.X - p2.X) + llabs(p1.Y - p2.Y);
    return p1 < p2;
}

bool cmp2(mp p1, mp p2)
{
    if (p1.Y > p2.Y) return true;
    if (p1.Y < p2.Y) return false;
    return p1.X > p2.X;
}

using sp = pair<set<ll>, ll>;

vector<mp> tmp;

bool cmp(sp a, sp b)
{
    if (a.X.size() < b.X.size()) return true;
    else if (a.X.size() > b.X.size()) return false;
    mp c = tmp[a.Y], d = tmp[b.Y];
    return c < d;
}

int main()
{
    ll res = 0;
    ll n; cin >> n;
    vector<mp> r, b;
    for (ll i = 0; i < n; i++) { ll x, y; cin >> x >> y; r.pb(mp(x, y)); }
    for (ll i = 0; i < n; i++) { ll x, y; cin >> x >> y; b.pb(mp(x, y)); }
    sort(r.begin(), r.end());
    sort(b.begin(), b.end());

//    set<ll> sss;
//    vector<sp> vs(n);
//    for (ll i = 0; i < n; i++) {
//        mp a = b[i];
//        set<ll> ss;
//        for (ll j = 0; j < n; j++) {
//            mp b = r[j];
//            if (b.X < a.X && b.Y < a.Y) {
//                ss.insert(j);
//                sss.insert(j);
//            }
//        }
//        vs[i] = sp(ss, i);
//        //pr_vars(i, a.X, a.Y, ss.size());
//    }

//    vector<bool> used(n);
//    tmp = b;
//    sort(vs.begin(), vs.end(), cmp);
//    for (ll i = 0; i < n; i++) {
//        mp a = b[vs[i].Y];
//        ll d2 = INF;
//        mp p = mp(-1, -1); ll idx = -1;
//        set<ll> ss = vs[i].X;
//        for (auto j: ss) {
//            mp b = r[j];
//            if (used[j]) continue;
//            if (b.X < a.X && b.Y < a.Y && mp(b.Y, b.X) > mp(p.Y, p.X)/*dist(a, b) < d2*/) {
//                d2 = dist(a, b);
//                p = b; idx = j;
//            }
//        }
//        if (idx >= 0) {
//            used[idx] = true;
//            res++;
//        }
//    }

    vector<bool> used(n);
    for (ll i = 0; i < n; i++) {
        mp a = b[i];
        ll d2 = INF;
        mp p = mp(-1, -1); ll idx = -1;
        for (ll j = 0; j < n; j++) {
            mp b = r[j];
            if (used[j]) continue;
            if (b.X < a.X && b.Y < a.Y && /*dist(a, b) < d2*/ mp(b.Y, b.X) > mp(p.Y, p.X)) {
                d2 = dist(a, b);
                p = b; idx = j;
            }
        }
        if (idx >= 0) {
            used[idx] = true;
            res++;
            //pr_vars(a.X, a.Y, p.X, p.Y);
        }
    }

    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256