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

ab=[]

for _ in range(M):

    ab.append(tuple(map(int, input().split())))





def func(n):

    seen[n]=True

    for val in lst[n]:

        if seen[val] == False:

            todo.append(val)

    if todo:

        func(todo.pop(-1))

    else:

        return None



count=0

for edge_to_check in ab:

    lst = [[] for _ in range(N+1)]

    seen = [False] * (N + 1)

    todo = []

    for el in ab:

        if el != edge_to_check:

            lst[el[0]].append(el[1])

            lst[el[1]].append(el[0])

    #print(lst)

    # DFS

    func(1)

    #print(edge_to_check, seen)

    if seen.count(False) > 1:

        count+=1

print(count)







from collections import deque





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



# 辺集合Eとグラフの構築

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

E = []

for _ in range(M):

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

    a -= 1

    b -= 1

    E.append((a, b))

    G[a].append(b)

    G[b].append(a)

# print(G)



cnt = 0

for edge_to_remove in E:

    

    i, j = edge_to_remove

    G[i].remove(j)

    G[j].remove(i)



    # 深さ優先探索

    seen = [False] * N

    todo = deque()

    todo.append(0)

    seen[0] = True

    while todo:

        here = todo.pop()

        for neighbor in G[here]:

            if seen[neighbor] == False:

                seen[neighbor] = True

                todo.append(neighbor)

    # print(seen)

    if False in seen:

        cnt += 1

    

    G[i].append(j)

    G[j].append(i)

print(cnt)

N, M = list(map(int, input().split()))
ab = []
for _ in range(M):
    ab.append(tuple(map(int, input().split())))


def func(n):
    seen[n] = True
    for val in lst[n]:
        if seen[val] == False:
            todo.append(val)
    if todo:
        func(todo.pop(-1))
    else:
        return None


count = 0
for edge_to_check in ab:
    lst = [[] for _ in range(N + 1)]
    seen = [False] * (N + 1)
    todo = []
    for el in ab:
        if el != edge_to_check:
            lst[el[0]].append(el[1])
            lst[el[1]].append(el[0])
    # print(lst)
    # DFS
    func(1)
    # print(edge_to_check, seen)
    if seen.count(False) > 1:
        count += 1
print(count)

from collections import deque

N, M = list(map(int, input().split()))
# 辺集合Eとグラフの構築
G = [[] for _ in range(N)]
E = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    E.append((a, b))
    G[a].append(b)
    G[b].append(a)
# print(G)
cnt = 0
for edge_to_remove in E:
    i, j = edge_to_remove
    G[i].remove(j)
    G[j].remove(i)
    # 深さ優先探索
    seen = [False] * N
    todo = deque()
    todo.append(0)
    seen[0] = True
    while todo:
        here = todo.pop()
        for neighbor in G[here]:
            if seen[neighbor] == False:
                seen[neighbor] = True
                todo.append(neighbor)
    # print(seen)
    if False in seen:
        cnt += 1
    G[i].append(j)
    G[j].append(i)
print(cnt)

+from collections import deque + -ab = [] +# 辺集合Eとグラフの構築 +G = [[] for _ in range(N)] +E = [] -    ab.append(tuple(map(int, input().split()))) - - -def func(n): -    seen[n] = True -    for val in lst[n]: -        if seen[val] == False: -            todo.append(val) -    if todo: -        func(todo.pop(-1)) -    else: -        return None - - -count = 0 -for edge_to_check in ab: -    lst = [[] for _ in range(N + 1)] -    seen = [False] * (N + 1) -    todo = [] -    for el in ab: -        if el != edge_to_check: -            lst[el[0]].append(el[1]) -            lst[el[1]].append(el[0]) -    # print(lst) -    # DFS -    func(1) -    # print(edge_to_check, seen) -    if seen.count(False) > 1: -        count += 1 -print(count) +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    E.append((a, b)) +    G[a].append(b) +    G[b].append(a) +# print(G) +cnt = 0 +for edge_to_remove in E: +    i, j = edge_to_remove +    G[i].remove(j) +    G[j].remove(i) +    # 深さ優先探索 +    seen = [False] * N +    todo = deque() +    todo.append(0) +    seen[0] = True +    while todo: +        here = todo.pop() +        for neighbor in G[here]: +            if seen[neighbor] == False: +                seen[neighbor] = True +                todo.append(neighbor) +    # print(seen) +    if False in seen: +        cnt += 1 +    G[i].append(j) +    G[j].append(i) +print(cnt)