def findunit(edges, N):

  roots = [i for i in range(N)]

  for edge in edges:

    if roots[edge[0]] == roots[edge[1]]:continue

    prv_root = roots[edge[1]]

    for idx, root in enumerate(roots):

      if root == prv_root:

        roots[idx] = roots[edge[0]]

  return roots



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

edges = [ [int(a) -1 for a in input().split()] for _ in range(M)]

ans = 0

for i in range(M):

  if len(set(findunit(edges[:i] + edges[i+1:], N))) != 1:ans += 1

print(ans)
from collections import deque





def is_all_nodes_connected():

    q = deque()

    used = set()

    q.append(1)

    used.add(1)

    while len(q) > 0:

        prv_node = q.pop()

        for node in g[prv_node]:

            if node in used:

                continue

            else:

                q.append(node)

                used.add(node)

    if len(used) == N:

        return True

    else:

        return False





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

g = {i: [] for i in range(1, N+1)}

AB = []

for _ in range(M):

    a, b = list(map(int, input().split()))

    g[a].append(b)

    g[b].append(a)

    AB.append([a, b])



ans = 0

for a, b in AB:

    g[a].remove(b)

    g[b].remove(a)

    if is_all_nodes_connected() is False:

        ans += 1

    g[a].append(b)

    g[b].append(a)



print(ans)

def findunit(edges, N):
    roots = [i for i in range(N)]
    for edge in edges:
        if roots[edge[0]] == roots[edge[1]]:
            continue
        prv_root = roots[edge[1]]
        for idx, root in enumerate(roots):
            if root == prv_root:
                roots[idx] = roots[edge[0]]
    return roots


N, M = list(map(int, input().split()))
edges = [[int(a) - 1 for a in input().split()] for _ in range(M)]
ans = 0
for i in range(M):
    if len(set(findunit(edges[:i] + edges[i + 1 :], N))) != 1:
        ans += 1
print(ans)

from collections import deque


def is_all_nodes_connected():
    q = deque()
    used = set()
    q.append(1)
    used.add(1)
    while len(q) > 0:
        prv_node = q.pop()
        for node in g[prv_node]:
            if node in used:
                continue
            else:
                q.append(node)
                used.add(node)
    if len(used) == N:
        return True
    else:
        return False


N, M = list(map(int, input().split()))
g = {i: [] for i in range(1, N + 1)}
AB = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    g[a].append(b)
    g[b].append(a)
    AB.append([a, b])
ans = 0
for a, b in AB:
    g[a].remove(b)
    g[b].remove(a)
    if is_all_nodes_connected() is False:
        ans += 1
    g[a].append(b)
    g[b].append(a)
print(ans)

-def findunit(edges, N): -    roots = [i for i in range(N)] -    for edge in edges: -        if roots[edge[0]] == roots[edge[1]]: -            continue -        prv_root = roots[edge[1]] -        for idx, root in enumerate(roots): -            if root == prv_root: -                roots[idx] = roots[edge[0]] -    return roots +from collections import deque + + +def is_all_nodes_connected(): +    q = deque() +    used = set() +    q.append(1) +    used.add(1) +    while len(q) > 0: +        prv_node = q.pop() +        for node in g[prv_node]: +            if node in used: +                continue +            else: +                q.append(node) +                used.add(node) +    if len(used) == N: +        return True +    else: +        return False -edges = [[int(a) - 1 for a in input().split()] for _ in range(M)] +g = {i: [] for i in range(1, N + 1)} +AB = [] +for _ in range(M): +    a, b = list(map(int, input().split())) +    g[a].append(b) +    g[b].append(a) +    AB.append([a, b]) -for i in range(M): -    if len(set(findunit(edges[:i] + edges[i + 1 :], N))) != 1: +for a, b in AB: +    g[a].remove(b) +    g[b].remove(a) +    if is_all_nodes_connected() is False: +    g[a].append(b) +    g[b].append(a)