from scipy.sparse.csgraph import dijkstra

N, M = list(map(int, input().split()))

edge = [list(map(int, input().split())) for _ in range(M)]



# 隣接行列

graph = [[0] * (N + 1) for _ in range(N + 1)]



for i, j in edge:

  graph[i][j] = 1

  

ans = 0

INF = 10 ** 9

for a, b in edge:

  # 辺を取り除く-> INF

  graph[a][b] = INF

  dist = dijkstra(graph, indices=a, directed=False) # directed=False -> 無効グラフ用

  if dist[b] >= INF:

    ans += 1

  # 元に戻す -> 1

  graph[a][b] = 1



print(ans)
# C - Bridge

# https://atcoder.jp/contests/abc075/tasks/abc075_c



from collections import deque



def dfs(n, start, graph):

  visited = [False] * n

  stack = deque()

  stack.append(start)

  visited[start] = True

  while stack:

    q = stack.popleft()

    nxts = graph[q]

    for nxt in nxts:

      if not visited[nxt]:

        visited[nxt] = True

        stack.append(nxt)

  return visited



n, m = list(map(int, input().split()))

edge = [list(map(int, input().split())) for _ in range(m)]



ans = 0

for i in range(m):

  graph = [[] for _ in range(n)]

  for itr, (a, b) in enumerate(edge):

    if itr != i:

      graph[a - 1].append(b - 1)

      graph[b - 1].append(a - 1)



  if not all(dfs(n, 0, graph)):

    ans += 1



print(ans)

from scipy.sparse.csgraph import dijkstra

N, M = list(map(int, input().split()))
edge = [list(map(int, input().split())) for _ in range(M)]
# 隣接行列
graph = [[0] * (N + 1) for _ in range(N + 1)]
for i, j in edge:
    graph[i][j] = 1
ans = 0
INF = 10**9
for a, b in edge:
    # 辺を取り除く-> INF
    graph[a][b] = INF
    dist = dijkstra(graph, indices=a, directed=False)  # directed=False -> 無効グラフ用
    if dist[b] >= INF:
        ans += 1
    # 元に戻す -> 1
    graph[a][b] = 1
print(ans)

# C - Bridge
# https://atcoder.jp/contests/abc075/tasks/abc075_c
from collections import deque


def dfs(n, start, graph):
    visited = [False] * n
    stack = deque()
    stack.append(start)
    visited[start] = True
    while stack:
        q = stack.popleft()
        nxts = graph[q]
        for nxt in nxts:
            if not visited[nxt]:
                visited[nxt] = True
                stack.append(nxt)
    return visited


n, m = list(map(int, input().split()))
edge = [list(map(int, input().split())) for _ in range(m)]
ans = 0
for i in range(m):
    graph = [[] for _ in range(n)]
    for itr, (a, b) in enumerate(edge):
        if itr != i:
            graph[a - 1].append(b - 1)
            graph[b - 1].append(a - 1)
    if not all(dfs(n, 0, graph)):
        ans += 1
print(ans)

-from scipy.sparse.csgraph import dijkstra +# C - Bridge +# https://atcoder.jp/contests/abc075/tasks/abc075_c +from collections import deque -N, M = list(map(int, input().split())) -edge = [list(map(int, input().split())) for _ in range(M)] -# 隣接行列 -graph = [[0] * (N + 1) for _ in range(N + 1)] -for i, j in edge: -    graph[i][j] = 1 + +def dfs(n, start, graph): +    visited = [False] * n +    stack = deque() +    stack.append(start) +    visited[start] = True +    while stack: +        q = stack.popleft() +        nxts = graph[q] +        for nxt in nxts: +            if not visited[nxt]: +                visited[nxt] = True +                stack.append(nxt) +    return visited + + +n, m = list(map(int, input().split())) +edge = [list(map(int, input().split())) for _ in range(m)] -INF = 10**9 -for a, b in edge: -    # 辺を取り除く-> INF -    graph[a][b] = INF -    dist = dijkstra(graph, indices=a, directed=False)  # directed=False -> 無効グラフ用 -    if dist[b] >= INF: +for i in range(m): +    graph = [[] for _ in range(n)] +    for itr, (a, b) in enumerate(edge): +        if itr != i: +            graph[a - 1].append(b - 1) +            graph[b - 1].append(a - 1) +    if not all(dfs(n, 0, graph)): -    # 元に戻す -> 1 -    graph[a][b] = 1