#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

const int MAX_V = 100001;
struct Graph {
    int V;
    vector<int> list[MAX_V];
    
    Graph(int n = 0) : V(n) {}
    void init(int n = 0) {V = n; for (int i = 0; i < MAX_V; ++i) list[i].clear();}
    void resize(int n = 0) { V = n; }
    inline vector<int>& operator [] (int i) {return list[i];}
    
    void connect(int f, int t) {
        list[f].push_back(t);
        list[t].push_back(f);
    }
    
    friend ostream& operator << (ostream& s, const Graph& G) {
        s << endl; for (int i = 0; i < G.V; ++i) {s << i << " : " << G.list[i] << endl;}return s;
    }
} G;

vector<vector<int> > scc;
Graph newG;
int cmp[MAX_V];
vector<pair<int,int> > bridges;

static int ord[MAX_V]; // order of node in DFS
static int low[MAX_V]; // minimum order of visitable node if we can use backedge once
static bool seen[MAX_V];
static int parent[MAX_V];

void DFSOfBridgeDecomposition(const Graph &G, int v) {
    static int time = 0;
    seen[v] = true;
    ord[v] = low[v] = time++;
    for (int i = 0; i < G.list[v].size(); ++i) {
        int to = G.list[v][i];
        if (seen[to]) {
            if (to != parent[v]) low[v] = min(low[v], low[to]);
            continue;
        }
        parent[to] = v;
        DFSOfBridgeDecomposition(G, to);
        low[v] = min(low[v], low[to]);
        if (low[to] > ord[v]) {
            bridges.push_back(make_pair(v, to));
        }
    }
}

static vector<int> comp;
static set<pair<int,int> > newGEdges;

void MakeTreeDFS(const Graph &G, int v, int tempCmp) {
    seen[v] = true;
    cmp[v] = tempCmp;
    for (int i = 0; i < G.list[v].size(); ++i) {
        int to = G.list[v][i];
        
        bool sameComp = true;
        if (seen[to]) sameComp = false;
        if (binary_search(bridges.begin(), bridges.end(), make_pair(v, to))
            || binary_search(bridges.begin(), bridges.end(), make_pair(to, v)))
            sameComp = false;
        
        if (!sameComp) {
            int toCmp = cmp[to];
            if (toCmp == -1) continue;
            if (toCmp != tempCmp) {
                if (!newGEdges.count(make_pair(toCmp, tempCmp))
                    && !newGEdges.count(make_pair(tempCmp, toCmp))) {
                    newGEdges.insert(make_pair(tempCmp, toCmp));
                    newG.connect(tempCmp, toCmp);
                }
            }
        }
        else {
            MakeTreeDFS(G, to, tempCmp);
        }
    }
    comp.push_back(v);
}

void BridgeDecomposition(const Graph &G) {
    for (int i = 0; i < MAX_V; ++i) {
        seen[i] = false;
        parent[i] = -1;
    }
    bridges.clear();
    for (int i = 0; i < G.V; ++i) {
        if (!seen[i]) {
            DFSOfBridgeDecomposition(G, i);
        }
    }
    sort(bridges.begin(), bridges.end());
    
    scc.clear();
    newG.init(G.V);
    newGEdges.clear();
    for (int i = 0; i < MAX_V; ++i) {
        seen[i] = false;
        cmp[i] = -1;
    }
    int tempCmp = 0;
    for (int v = 0; v < G.V; ++v) {
        if (seen[v]) continue;
        comp.clear();
        MakeTreeDFS(G, v, tempCmp);
        scc.push_back(comp);
        ++tempCmp;
    }
    newG.resize(tempCmp);
}


int N, M;
int main() {
    while (cin >> N >> M) {
        G.init(N);
        for (int i = 0; i < M; ++i) {
            int a, b;
            cin >> a >> b;
            --a, --b;
            G.connect(a, b);
        }
        BridgeDecomposition(G);
        cout << bridges.size() << endl;
    }
}













Measured memory_bytes: 6400