// C - Bridge
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> V;
vector<int> vis;

void dfs(int a, int b, int f){
	if(vis[f]) return;
	vis[f] = 1;
	for(int t:V[f]) if(f!=a || t!=b) dfs(a, b, t);
}

int main(){
	int N, M; cin>>N>>M;
	vector<pair<int,int>> E;
	for(int i=0; i<M; ++i){
		int a,b; cin>>a>>b; --a, --b;
		E.emplace_back(a,b);
	}
	V.resize(N);
	for(auto [a,b]:E){
		V[a].push_back(b);
		V[b].push_back(a);
	}
	vis.resize(N);
	int ans = 0;
	for(auto [a,b]:E){
		for(auto& x:vis) x = 0;
		dfs(a, b, a);
		if(!vis[b]) ans++;
	}
	cout<< ans <<endl;
}
