import std.stdio; // readln
import std.array; // split
import std.conv; // to
import std.typecons;

bool[][] g;

void main(){
	string[] s = split(readln());
	int N = to!int(s[0]);
	int M = to!int(s[1]);
	g = new bool[][](N,N);

	alias Tuple!(int,int) pair;
	pair[] p = new pair[](M);
	for(int i = 0; i < M; i++){
		s = split(readln());
		int a = to!int(s[0]);
		int b = to!int(s[1]);
		a--; b--;

		p[i] = pair(a,b);
		g[a][b] = g[b][a] = true;
	}

	int cnt = 0;
	for(int i = 0; i < M; i++){
		bool[] used = new bool[](N);
		foreach (ref elem; used) {
			elem = false;
		}

		g[p[i][0]][p[i][1]] = g[p[i][1]][p[i][0]] = 0;
		dfs(0,used);
		g[p[i][0]][p[i][1]] = g[p[i][1]][p[i][0]] = 1;
		if(!check(used)){
			cnt++;
		}
	}

	writeln(cnt);
}

void dfs(int cur, bool[] used){
	used[cur] = true;
	for(int i = 0; i < g.length; i++){
		if(g[cur][i] && !used[i]){
			dfs(i, used);
		}
	}
}

bool check(bool[] used){
	for(int i = 0; i < used.length; i++){
		if(!used[i]) return false;
	}
	return true;
}
