import numpy as np

from scipy.sparse.csgraph import connected_components

from scipy.sparse import csr_matrix

def main():

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

    graph=[[0 for i in range(n)] for j in range(n)]

    graph_del=[]

    ans = 0



    for i in range(m):

        e_1,e_2=list(map(int,input().split(' ')))

        graph[e_1-1][e_2-1]=1

        graph[e_2-1][e_1-1]=1

        graph_del.append((e_1,e_2))



    for i,j in graph_del:

        graph[i-1][j-1]=0

        graph[j-1][i-1]=0

        if connected_components(np.array(graph),return_labels=False)!=1:

            ans += 1

        graph[i-1][j-1]=1

        graph[j-1][i-1]=1

    print(ans)









if __name__ == '__main__':

    main()

class UnionFind:

    def __init__(self,N):

        self.par =[-1 for i in range(N)]

    def find(self,x):

        if self.par[x] < 0:

            return x

        else:

            self.par[x] = self.find(self.par[x])

            return self.par[x]



    def unite(self,x,y):

        x = self.find(x)

        y = self.find(y)

        if x==y:

            return

        if self.par[x] > self.par[y]:

            x,y = y,x

        self.par[x] +=self.par[y]

        self.par[y] = x



    def size(self,x):

        return -self.par[self.find(x)]

    def same(self,x,y):

        return self.find(x)==self.find(y)



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

q = [list(map(int,input().split(' '))) for i in range(M)]

ans = 0

for i in range(M):

    tmp = q[:i]+q[i+1:]

    uf = UnionFind(N)

    for j,k in tmp:

        uf.unite(j-1,k-1)

    for l in range(N):

        if uf.size(l) != N:

            ans += 1

            break

print(ans)
import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix


def main():
    n, m = list(map(int, input().split(" ")))
    graph = [[0 for i in range(n)] for j in range(n)]
    graph_del = []
    ans = 0
    for i in range(m):
        e_1, e_2 = list(map(int, input().split(" ")))
        graph[e_1 - 1][e_2 - 1] = 1
        graph[e_2 - 1][e_1 - 1] = 1
        graph_del.append((e_1, e_2))
    for i, j in graph_del:
        graph[i - 1][j - 1] = 0
        graph[j - 1][i - 1] = 0
        if connected_components(np.array(graph), return_labels=False) != 1:
            ans += 1
        graph[i - 1][j - 1] = 1
        graph[j - 1][i - 1] = 1
    print(ans)


if __name__ == "__main__":
    main()

class UnionFind:
    def __init__(self, N):
        self.par = [-1 for i in range(N)]

    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

    def size(self, x):
        return -self.par[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)


N, M = list(map(int, input().split(" ")))
q = [list(map(int, input().split(" "))) for i in range(M)]
ans = 0
for i in range(M):
    tmp = q[:i] + q[i + 1 :]
    uf = UnionFind(N)
    for j, k in tmp:
        uf.unite(j - 1, k - 1)
    for l in range(N):
        if uf.size(l) != N:
            ans += 1
            break
print(ans)

-import numpy as np -from scipy.sparse.csgraph import connected_components -from scipy.sparse import csr_matrix +class UnionFind: +    def __init__(self, N): +        self.par = [-1 for i in range(N)] + +    def find(self, x): +        if self.par[x] < 0: +            return x +        else: +            self.par[x] = self.find(self.par[x]) +            return self.par[x] + +    def unite(self, x, y): +        x = self.find(x) +        y = self.find(y) +        if x == y: +            return +        if self.par[x] > self.par[y]: +            x, y = y, x +        self.par[x] += self.par[y] +        self.par[y] = x + +    def size(self, x): +        return -self.par[self.find(x)] + +    def same(self, x, y): +        return self.find(x) == self.find(y) -def main(): -    n, m = list(map(int, input().split(" "))) -    graph = [[0 for i in range(n)] for j in range(n)] -    graph_del = [] -    ans = 0 -    for i in range(m): -        e_1, e_2 = list(map(int, input().split(" "))) -        graph[e_1 - 1][e_2 - 1] = 1 -        graph[e_2 - 1][e_1 - 1] = 1 -        graph_del.append((e_1, e_2)) -    for i, j in graph_del: -        graph[i - 1][j - 1] = 0 -        graph[j - 1][i - 1] = 0 -        if connected_components(np.array(graph), return_labels=False) != 1: +N, M = list(map(int, input().split(" "))) +q = [list(map(int, input().split(" "))) for i in range(M)] +ans = 0 +for i in range(M): +    tmp = q[:i] + q[i + 1 :] +    uf = UnionFind(N) +    for j, k in tmp: +        uf.unite(j - 1, k - 1) +    for l in range(N): +        if uf.size(l) != N: -        graph[i - 1][j - 1] = 1 -        graph[j - 1][i - 1] = 1 -    print(ans) - - -if __name__ == "__main__": -    main() +            break +print(ans)