import heapq

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

ab = [list([int(x)-1 for x in input().split()]) for _ in range(M)]

ans = 0



def dijkstra(s, graph, n):

  dist = [float('inf')]*n

  dist[s] = 0

  num = [0]*n

  num[s] = 1

  q = [[0, s]]

  heapq.heapify(q)

  while q:

    c, u = heapq.heappop(q)

    if dist[u] < c:

      continue

    for v, weight in graph[u]:

      if dist[v] > dist[u] + weight:

        dist[v] = dist[u] + weight

        num[v] = num[u]

        heapq.heappush(q, [dist[v], v])

      elif dist[v] == dist[u] + weight:

        num[v] += num[u]

  return dist, num



for i in range(M):

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

  for j in range(M):

    if i != j:

      a, b = ab[j]

      graph[a] += [[b, 1]]

      graph[b] += [[a, 1]]



  for j in range(N):

    d, _ = dijkstra(j, graph, N)

    if max(d) == float('inf'):

      ans += 1

      break

print(ans)

import sys

sys.setrecursionlimit(1000000000)

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

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

visited = [0]*N

ab = []

ans = 0



def dfs(u):

  visited[u] = 1

  for v in range(N):

    if graph[u][v] == 1 and visited[v] == 0:

      dfs(v)



for _ in range(M):

  a, b = [int(x)-1 for x in input().split()]

  graph[a][b] = 1

  graph[b][a] = 1

  ab += [[a, b]]



for _ in range(M):

  a, b = ab.pop(0)

  graph[a][b] = 0

  graph[b][a] = 0



  for i in range(N):

    visited[i] = 0

  

  dfs(0)

  

  if sum(visited) != N:

    ans += 1



  graph[a][b] = 1

  graph[b][a] = 1



print(ans)
import heapq

N, M = list(map(int, input().split()))
ab = [list([int(x) - 1 for x in input().split()]) for _ in range(M)]
ans = 0


def dijkstra(s, graph, n):
    dist = [float("inf")] * n
    dist[s] = 0
    num = [0] * n
    num[s] = 1
    q = [[0, s]]
    heapq.heapify(q)
    while q:
        c, u = heapq.heappop(q)
        if dist[u] < c:
            continue
        for v, weight in graph[u]:
            if dist[v] > dist[u] + weight:
                dist[v] = dist[u] + weight
                num[v] = num[u]
                heapq.heappush(q, [dist[v], v])
            elif dist[v] == dist[u] + weight:
                num[v] += num[u]
    return dist, num


for i in range(M):
    graph = [[] for _ in range(N)]
    for j in range(M):
        if i != j:
            a, b = ab[j]
            graph[a] += [[b, 1]]
            graph[b] += [[a, 1]]
    for j in range(N):
        d, _ = dijkstra(j, graph, N)
        if max(d) == float("inf"):
            ans += 1
            break
print(ans)

import sys

sys.setrecursionlimit(1000000000)
N, M = list(map(int, input().split()))
graph = [[0] * N for _ in range(N)]
visited = [0] * N
ab = []
ans = 0


def dfs(u):
    visited[u] = 1
    for v in range(N):
        if graph[u][v] == 1 and visited[v] == 0:
            dfs(v)


for _ in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    graph[a][b] = 1
    graph[b][a] = 1
    ab += [[a, b]]
for _ in range(M):
    a, b = ab.pop(0)
    graph[a][b] = 0
    graph[b][a] = 0
    for i in range(N):
        visited[i] = 0
    dfs(0)
    if sum(visited) != N:
        ans += 1
    graph[a][b] = 1
    graph[b][a] = 1
print(ans)

-import heapq +import sys +sys.setrecursionlimit(1000000000) -ab = [list([int(x) - 1 for x in input().split()]) for _ in range(M)] +graph = [[0] * N for _ in range(N)] +visited = [0] * N +ab = [] -def dijkstra(s, graph, n): -    dist = [float("inf")] * n -    dist[s] = 0 -    num = [0] * n -    num[s] = 1 -    q = [[0, s]] -    heapq.heapify(q) -    while q: -        c, u = heapq.heappop(q) -        if dist[u] < c: -            continue -        for v, weight in graph[u]: -            if dist[v] > dist[u] + weight: -                dist[v] = dist[u] + weight -                num[v] = num[u] -                heapq.heappush(q, [dist[v], v]) -            elif dist[v] == dist[u] + weight: -                num[v] += num[u] -    return dist, num +def dfs(u): +    visited[u] = 1 +    for v in range(N): +        if graph[u][v] == 1 and visited[v] == 0: +            dfs(v) -for i in range(M): -    graph = [[] for _ in range(N)] -    for j in range(M): -        if i != j: -            a, b = ab[j] -            graph[a] += [[b, 1]] -            graph[b] += [[a, 1]] -    for j in range(N): -        d, _ = dijkstra(j, graph, N) -        if max(d) == float("inf"): -            ans += 1 -            break +for _ in range(M): +    a, b = [int(x) - 1 for x in input().split()] +    graph[a][b] = 1 +    graph[b][a] = 1 +    ab += [[a, b]] +for _ in range(M): +    a, b = ab.pop(0) +    graph[a][b] = 0 +    graph[b][a] = 0 +    for i in range(N): +        visited[i] = 0 +    dfs(0) +    if sum(visited) != N: +        ans += 1 +    graph[a][b] = 1 +    graph[b][a] = 1