#include <bits/stdc++.h>
using namespace std;
vector<bool> removed;
vector<bool> visited;
vector<vector<pair<int, int>>> g;
void dfs(int u)
{
visited[u] = true;
for (auto [v, id] : g[u])
{
if (visited[v] || removed[id])
continue;
dfs(v);
}
}
int main()
{
int n, m;
cin >> n >> m;
g.resize(n);
visited.resize(n);
removed.resize(m);
for (int i = 0; i < m; i++)
{
int u, v;
cin >> u >> v;
u--; v--;
g[u].emplace_back(v, i);
g[v].emplace_back(u, i);
}
int ans = 0;
for (int i = 0; i < m; i++)
{
removed[i] = true;
dfs(0);
int cnt = 0;
for (int u = 0; u < n; u++)
{
if (visited[u])
{
cnt++;
visited[u] = false;
}
}
if (cnt < n)
ans++;
removed[i] = false;
}
cout << ans << "\n";
return 0;
}