#include <bits/stdc++.h>
using namespace std;
int n,m,a[51],b[51];
bool graph[51][51],vis[51];
void dfs(int v){
	if(vis[v])return;
	vis[v]=1;
	for(int i=0;i<n;i++){
		if(graph[v][i])dfs(i);
	}
}
int main(){
	int i,j;
	cin>>n>>m;
	for(i=0;i<m;i++){
		cin>>a[i]>>b[i];
		a[i]--,b[i]--;
		graph[a[i]][b[i]]=graph[b[i]][a[i]]=1;
	}
	int ans=0;
	for(i=0;i<m;i++){
		graph[a[i]][b[i]]=graph[b[i]][a[i]]=0;
		for(j=0;j<n;j++)vis[j]=0;
		dfs(0);
		for(j=0;j<n;j++){
			if(!vis[j]){
				ans++;
				break;
			}
		}
		graph[a[i]][b[i]]=graph[b[i]][a[i]]=1;
	}
	cout<<ans;
	return 0;
}
