import numpy as np

from scipy.sparse.csgraph import floyd_warshall



inf=10**9

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

g1=np.ones((n,n),dtype=int) * inf



bridge=[]

for _ in range(m):

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

    bridge.append((a-1, b-1))

    g1[a-1][b-1]=1

    g1[b-1][a-1]=1



ans=0

for a,b in bridge:

    graph=np.copy(g1)

    graph[a][b]=inf

    graph[b][a]=inf

    graph=floyd_warshall(graph)

    if inf in graph:

        ans+=1



print(ans)
from scipy.sparse.csgraph import floyd_warshall

import numpy as np

import sys



input = sys.stdin.readline



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

AB = []

edge = np.zeros((N, N), dtype=int)

for _ in range(M):

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

    a -= 1

    b -= 1

    AB.append((a, b))

    edge[a][b] = 1

    edge[b][a] = 1



ans = 0

for i in range(M):

    graph = np.copy(edge)

    a, b = AB[i]

    graph[a][b] = 0

    graph[b][a] = 0

    fw = floyd_warshall(graph)

    if fw.max() > 10000:

        ans += 1



print(ans)

import numpy as np
from scipy.sparse.csgraph import floyd_warshall

inf = 10**9
n, m = list(map(int, input().split()))
g1 = np.ones((n, n), dtype=int) * inf
bridge = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    bridge.append((a - 1, b - 1))
    g1[a - 1][b - 1] = 1
    g1[b - 1][a - 1] = 1
ans = 0
for a, b in bridge:
    graph = np.copy(g1)
    graph[a][b] = inf
    graph[b][a] = inf
    graph = floyd_warshall(graph)
    if inf in graph:
        ans += 1
print(ans)

from scipy.sparse.csgraph import floyd_warshall
import numpy as np
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
AB = []
edge = np.zeros((N, N), dtype=int)
for _ in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    AB.append((a, b))
    edge[a][b] = 1
    edge[b][a] = 1
ans = 0
for i in range(M):
    graph = np.copy(edge)
    a, b = AB[i]
    graph[a][b] = 0
    graph[b][a] = 0
    fw = floyd_warshall(graph)
    if fw.max() > 10000:
        ans += 1
print(ans)

+from scipy.sparse.csgraph import floyd_warshall -from scipy.sparse.csgraph import floyd_warshall +import sys -inf = 10**9 -n, m = list(map(int, input().split())) -g1 = np.ones((n, n), dtype=int) * inf -bridge = [] -for _ in range(m): +input = sys.stdin.readline +N, M = list(map(int, input().split())) +AB = [] +edge = np.zeros((N, N), dtype=int) +for _ in range(M): -    bridge.append((a - 1, b - 1)) -    g1[a - 1][b - 1] = 1 -    g1[b - 1][a - 1] = 1 +    a -= 1 +    b -= 1 +    AB.append((a, b)) +    edge[a][b] = 1 +    edge[b][a] = 1 -for a, b in bridge: -    graph = np.copy(g1) -    graph[a][b] = inf -    graph[b][a] = inf -    graph = floyd_warshall(graph) -    if inf in graph: +for i in range(M): +    graph = np.copy(edge) +    a, b = AB[i] +    graph[a][b] = 0 +    graph[b][a] = 0 +    fw = floyd_warshall(graph) +    if fw.max() > 10000: