n, m = map(int, input().split())
g = [[] for i in range(n)]
vis = [False] * n
removed = [False] * m
for i in range(m):
u, v = map(int, input().split())
u -= 1
v -= 1
g[u].append((v, i))
g[v].append((u, i))
def dfs(u):
vis[u] = True
for (v, i) in g[u]:
if vis[v] or removed[i]:
continue
dfs(v)
ans = 0
for i in range(m):
vis = [False] * n
removed[i] = True
dfs(0)
if not all(vis):
ans += 1
removed[i] = False
print(ans)