import std.stdio;
import std.conv;
import std.typecons;

alias Tuple!(int,int) elist;

elist [][] G;
bool [] vis;

int dfs(int n, int tag) {
	if(vis[n]) return 0;
	vis[n] = true;
	int res = 1;
	for(int i = 0; i < G[n].length; i++) {
		if(G[n][i][1] != tag)
			res += dfs(G[n][i][0], tag);
	}
	return res;
}

void main() {
	int N, M;
	readf("%d %d\n", &N, &M);
	G.length = N;
	vis.length = N;
	for(int i = 0; i < M; i++) {
		int a, b;
		readf("%d %d\n", &a, &b);
		a--; b--;
		G[a] ~= elist(b,i);
		G[b] ~= elist(a,i);
	}
	int res = 0;
	for(int i = 0; i < M; i++) {
		for(int j = 0; j < N; j++) vis[j] = false;
		if(N != dfs(0,i)) res++;
	}
	writeln(res);
}
