#ifndef __UNION_FIND_H__0004__
#define __UNION_FIND_H__0004__
 
class UnionFindTree {
	int whole_size_m;
	int* parent_p_m;	// 根である場合は自分自身の添え字を入れる
	int* rank_p_m;
	int* size_p_m;		// 集合のサイズ(根に大きさを書く)
 
	bool Is_valid_index(int index);
	int Root_of_rec(int index);
public:
	UnionFindTree(int whole_size);
	~UnionFindTree();
 
	int Root_of(int index);
	void Unite(int index_l, int index_r);
	bool Are_together(int index_l, int index_r);
	int Size_of_set(int index);
};
 
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
 
/* 
 * std::min を使う際、
 *		SegmentTree<int> seg(N, INF, (const int&(*)(const int&, const int&))std::min);
 * と書かなければならないので、後述の Min を使って
 *		SegmentTree<int> seg(N, INF, Min<int>());
 * とする。
 */
template <typename T>
class SegmentTree {
	using FuncType = std::function<T(const T&, const T&)>;
 
private:
	T* val_p_m;
	const T init_val_m;
	const int size_m;
	const int rank_m;
 
	const FuncType func_m;
 
	T Query_rec(int range_left, int range_right, int node_index, int node_range_left, int node_range_right);
	bool Is_valid_index(int index);
public:
	SegmentTree(int size, const T& init_val, const FuncType& func);
	~SegmentTree();
 
	void Update(int pos, const T& val);
	T Query(int range_left, int range_right);
};
 
template<typename T>
T SegmentTree<T>::Query_rec(int range_left, int range_right, int node_index, int node_range_left, int node_range_right) {
	if (node_range_right <= range_left || range_right <= node_range_left) return init_val_m;
	if (range_left <= node_range_left && node_range_right <= range_right) return val_p_m[node_index];
 
	int node_range_mid = (node_range_left + node_range_right) / 2;
	const T val_left = Query_rec(range_left, range_right, node_index * 2, node_range_left, node_range_mid);
	const T val_right = Query_rec(range_left, range_right, node_index * 2 + 1, node_range_mid, node_range_right);
	return func_m(val_left, val_right);
}
 
template<typename T>
inline bool SegmentTree<T>::Is_valid_index(int index) {
	return index >= 0 && index < size_m;
}
 
template<typename T>
SegmentTree<T>::SegmentTree(int size, const T& init_val, const FuncType& func)
	: init_val_m(init_val), size_m(size), rank_m((int)std::log2(size - 1) + 2), func_m(func) {
 
	val_p_m = new T[1 << rank_m];
	std::fill(val_p_m + (1 << (rank_m - 1)), val_p_m + (1 << rank_m), init_val_m);
 
	for (int i = (1 << (rank_m - 1)) - 1; i >= 1; --i) {
		val_p_m[i] = func_m(val_p_m[i * 2], val_p_m[i * 2 + 1]);
	}
}
 
template<typename T>
inline SegmentTree<T>::~SegmentTree() {
	delete[] val_p_m;
}
 
template<typename T>
void SegmentTree<T>::Update(int pos, const T& val) {
	assert(Is_valid_index(pos));
 
	int i = pos + (1 << (rank_m - 1));
	val_p_m[i] = val;
	while (i > 1) {
		i /= 2;
		val_p_m[i] = func_m(val_p_m[i * 2], val_p_m[i * 2 + 1]);
	}
}
 
template<typename T>
T SegmentTree<T>::Query(int range_left, int range_right) {
	assert(Is_valid_index(range_left));
	assert(Is_valid_index(range_right - 1));
 
	return Query_rec(range_left, range_right, 1, 0, 1 << (rank_m - 1));
}
 
template<typename T>
class Max {
public:
	const T& operator()(const T& a, const T& b) const {
		return std::max<T>(a, b);
	}
};
 
template<typename T>
class Min {
public:
	const T& operator()(const T& a, const T& b) const {
		return std::min<T>(a, b);
	}
};
 
#endif
 
#if _DEBUG
#include "Union_Find.h"
#endif
 
bool UnionFindTree::Is_valid_index(int index) {
	return index >= 0 && index < whole_size_m;
}
 
int UnionFindTree::Root_of_rec(int index) {
	if (parent_p_m[index] == index) {
		return index;
	} else {
		return parent_p_m[index] = Root_of_rec(parent_p_m[index]);
	}
}
 
UnionFindTree::UnionFindTree(int whole_size)
	: whole_size_m(whole_size) {
	parent_p_m = new int[whole_size_m];
	rank_p_m = new int[whole_size_m];
	size_p_m = new int[whole_size_m];
	for (int i = 0; i < whole_size_m; ++i) {
		parent_p_m[i] = i;
		rank_p_m[i] = 1;
		size_p_m[i] = 1;
	}
}
 
UnionFindTree::~UnionFindTree() {
	delete[] parent_p_m;
	delete[] rank_p_m;
	delete[] size_p_m;
}
 
int UnionFindTree::Root_of(int index) {
	if (Is_valid_index(index) == false) return -1;
	return Root_of_rec(index);
}
 
void UnionFindTree::Unite(int index_l, int index_r) {
	if (Is_valid_index(index_l) == false || Is_valid_index(index_r) == false) return;
	int root_l = Root_of(index_l);
	int root_r = Root_of(index_r);
	if (root_l == root_r) return;
 
	if (rank_p_m[root_l] > rank_p_m[root_r]) {
		parent_p_m[root_r] = root_l;
		size_p_m[root_r] += root_l;
	} else {
		parent_p_m[root_l] = root_r;
		size_p_m[root_l] += root_r;
		if (rank_p_m[root_l] == rank_p_m[root_r]) ++rank_p_m[root_r];
	}
}
 
bool UnionFindTree::Are_together(int index_l, int index_r) {
	return Root_of(index_l) == Root_of(index_r);
}
 
int UnionFindTree::Size_of_set(int index) {
	return size_p_m[index];
}
 
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
 
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;
#define REP(i,a,n) for(int i = (a); i < (int)(n); ++i)
#define REPM(i,n,a) for(int i = ((n) - 1); i >= (a); --i)
#define FLOAT setprecision(16)
#define INSIDE(i,j,H,W) ((i) >= 0 && (i) < (H) && (j) >= 0 && (j) < (W))
#define YesNo(b) (b ? "Yes" : "No")
#define YESNO(b) (b ? "YES" : "NO")
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;
 
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(begin(dest), end(dest), val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
 
// all_of
// partial_sum, adjacent_difference
 
#if _DEBUG
#include "IntMod.h"
#include "Union_Find.h"
#include "Graph.h"
#include "Range.h"
#include "Global.h"
#include "Flow_Solver.h"
#endif
 
#if 1234567891
#include <array>
#include <unordered_set>
#include <unordered_map>
template<typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif
 
template<class Pair>
struct CompBySecond {
	bool operator()(const Pair& left, const Pair& right) {
		return left.second < right.second || (left.second == right.second && left.first < right.first);
	}
};
 
int N, M;
int A[50], B[50];
 
bool K(int d) {
	UnionFindTree U(N);
	REP(i, 0, M) {
		if (i == d) continue;
		U.Unite(A[i], B[i]);
	}
	bool ok = true;
	REP(i, 1, N) {
		if (!U.Are_together(0, i)) ok = false;
	}
	return !ok;
}
 
int main() {
	cin >> N >> M;
	REP(i, 0, M) {
		cin >> A[i] >> B[i];
		--A[i]; --B[i];
	}
 
	int sum = 0;
	REP(i, 0, M) {
		sum += K(i);
	}
	cout << sum << endl;
	return 0;
}
 

Measured memory_bytes: 256