from copy import deepcopy

from collections import deque

from heapq import heappush, heappop





def warshallfloyd(cost,V):

    INF = float("inf")

    for k in range(V):

        for i in range(V):

            for j in range(V):

                if cost[i][k]!=INF and cost[k][j]!=INF:

                    cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])



    for i in cost:

        if float("inf") in i:

            return False

    

    return True



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

edge = [[float("inf") for i in range(N)] for j in range(N)]

ab = []

for _ in range(M):

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

    ab.append([a-1,b-1])

    edge[a-1][b-1] = 1

    edge[b-1][a-1] = 1



ans = 0



for a,b in ab:

    tmp = deepcopy(edge)

    tmp[a][b] = float("inf")

    tmp[b][a] = float("inf")

    if not warshallfloyd(tmp,N):

        ans += 1



print(ans)

from scipy.sparse.csgraph import floyd_warshall

from copy import deepcopy



def check(a):

    dist = floyd_warshall(a)



    for i in dist:

        if float("inf") in i:

            return True

    return False



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



edge = [[float("inf") for i in range(N)] for j in range(N)]





ab = []

for _ in range(M):

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

    ab.append((a,b))

    edge[a-1][b-1] = 1

    edge[b-1][a-1] = 1



ans = 0

for a,b in ab:

    tmp = deepcopy(edge)

    tmp[a-1][b-1] = float("inf")

    tmp[b-1][a-1] = float("inf")



    if check(tmp):

        ans += 1



print(ans)
from copy import deepcopy
from collections import deque
from heapq import heappush, heappop


def warshallfloyd(cost, V):
    INF = float("inf")
    for k in range(V):
        for i in range(V):
            for j in range(V):
                if cost[i][k] != INF and cost[k][j] != INF:
                    cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])
    for i in cost:
        if float("inf") in i:
            return False
    return True


N, M = list(map(int, input().split()))
edge = [[float("inf") for i in range(N)] for j in range(N)]
ab = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    ab.append([a - 1, b - 1])
    edge[a - 1][b - 1] = 1
    edge[b - 1][a - 1] = 1
ans = 0
for a, b in ab:
    tmp = deepcopy(edge)
    tmp[a][b] = float("inf")
    tmp[b][a] = float("inf")
    if not warshallfloyd(tmp, N):
        ans += 1
print(ans)

from scipy.sparse.csgraph import floyd_warshall
from copy import deepcopy


def check(a):
    dist = floyd_warshall(a)
    for i in dist:
        if float("inf") in i:
            return True
    return False


N, M = list(map(int, input().split()))
edge = [[float("inf") for i in range(N)] for j in range(N)]
ab = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
    edge[a - 1][b - 1] = 1
    edge[b - 1][a - 1] = 1
ans = 0
for a, b in ab:
    tmp = deepcopy(edge)
    tmp[a - 1][b - 1] = float("inf")
    tmp[b - 1][a - 1] = float("inf")
    if check(tmp):
        ans += 1
print(ans)

+from scipy.sparse.csgraph import floyd_warshall -from collections import deque -from heapq import heappush, heappop -def warshallfloyd(cost, V): -    INF = float("inf") -    for k in range(V): -        for i in range(V): -            for j in range(V): -                if cost[i][k] != INF and cost[k][j] != INF: -                    cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]) -    for i in cost: +def check(a): +    dist = floyd_warshall(a) +    for i in dist: -            return False -    return True +            return True +    return False -    ab.append([a - 1, b - 1]) +    ab.append((a, b)) -    tmp[a][b] = float("inf") -    tmp[b][a] = float("inf") -    if not warshallfloyd(tmp, N): +    tmp[a - 1][b - 1] = float("inf") +    tmp[b - 1][a - 1] = float("inf") +    if check(tmp):