#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld =long double;
//#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
using namespace std;
typedef pair<int, int> pii;
typedef pair<int,pii> piii;
#define mp make_pair
#define MAX 100000
vector<vector<int>>edge(MAX);
bool visited[MAX];
int prenum[MAX],parent[MAX],lowest[MAX],timer;
int N;
void dfs(int current,int prev){
    prenum[current]=lowest[current]=timer;
    timer++;
    visited[current]=true;
    int  next;
    for(int i=0;i<edge[current].size();i++){
        next=edge[current][i];
        if(!visited[next]){
            parent[next]=current;
            dfs(next,current);
            lowest[current]=min(lowest[current],lowest[next]);
        }else if(next != prev){
            lowest[current] = min(lowest[current],prenum[next]);
        }
    }
}
void art_point(){
    timer=1;
    dfs(0,-1);
    map<int,int>Mp;
    int np=0;
    for(int i=1;i<N;i++){
        int p=parent[i];
        if(p==0)np++;
        else if(prenum[p]<=lowest[i])Mp[p]++;
        if(np>1)Mp[0]++;
    }
        for(auto itr:Mp)
            cout<<itr.first<<endl;
    
}
signed main(){
    int m;
    cin>>N>>m;
    edge.resize(N);
    rep(i,N)visited[i]=false;
    for(int i=0;i<m;i++){
        int s,t;
        cin>>s>>t;
        edge[s].push_back(t);
        edge[t].push_back(s);
    }
    art_point();
}
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBUG
int main(){
    int n;
    cin>>n;
    vpii red(n),blue(n);
    rep(i,n){
        int a,b;
        cin>>a>>b;
        red[i]=mp(a,b);
    }
    rep(i,n){
        int c,d;
        cin>>c>>d;
        blue[i]=mp(d,c);
    }
    sort(all(red));
    reverse(all(red));
    sort(all(blue));
    rep(i,n){
        int c,d;
        tie(d,c)=blue[i];
        blue[i]=mp(c,d);
    }
    vbo tmp(n,true);
    int ans=0;
    rep(i,n){
        rep(j,n){
            if(red[i].first<blue[j].first&&red[i].second<blue[j].second&&tmp[j]){
                ans++;
                tmp[j]=false;
                break;
            }
        }
    }
    cout<<ans<<endl;
}