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

edges = []

for _ in range(M):

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

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



nodes = [0]*N



mat = [[0]*N for _ in range(N)]



for s, g in edges:

    nodes[s] += 1

    nodes[g] += 1

    mat[s][g] = 1

    mat[g][s] = 1



ans = 0





def check(nodes):

    return all(n != 1 for n in nodes)





ans = 0

while not check(nodes):

    for i in range(N):

        if nodes[i] == 1:

            for j in range(N):

                if mat[i][j]:

                    mat[i][j] = 0

                    mat[j][i] = 0

                    ans += 1

                    nodes[i] -= 1

                    nodes[j] -= 1

                    break

print(ans)



class UnionFind:

    def __init__(self, size):

        self.table = [i for i in range(size)]



    def find(self, x):

        return self.table[x]



    def union(self, x, y):

        x1 = self.find(x)

        y1 = self.find(y)



        if x1 == y1:

            return False



        for i in range(len(self.table)):

            if self.table[i] == y1:

                self.table[i] = x1

        return True





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



edges = []

for _ in range(M):

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

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



mat = [[0]*N for _ in range(N)]

for s, g in edges:

    mat[s][g] = 1

    mat[g][s] = 1



ans = 0



for i in range(M):

    uni = UnionFind(N)



    for j in range(M):

        if i != j:

            uni.union(edges[j][0], edges[j][1])



    if not all(uni.find(0) == uni.find(x) for x in range(N)):

        ans += 1

print(ans)

N, M = list(map(int, input().split()))
edges = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.append([a - 1, b - 1])
nodes = [0] * N
mat = [[0] * N for _ in range(N)]
for s, g in edges:
    nodes[s] += 1
    nodes[g] += 1
    mat[s][g] = 1
    mat[g][s] = 1
ans = 0


def check(nodes):
    return all(n != 1 for n in nodes)


ans = 0
while not check(nodes):
    for i in range(N):
        if nodes[i] == 1:
            for j in range(N):
                if mat[i][j]:
                    mat[i][j] = 0
                    mat[j][i] = 0
                    ans += 1
                    nodes[i] -= 1
                    nodes[j] -= 1
                    break
print(ans)

class UnionFind:
    def __init__(self, size):
        self.table = [i for i in range(size)]

    def find(self, x):
        return self.table[x]

    def union(self, x, y):
        x1 = self.find(x)
        y1 = self.find(y)
        if x1 == y1:
            return False
        for i in range(len(self.table)):
            if self.table[i] == y1:
                self.table[i] = x1
        return True


N, M = list(map(int, input().split()))
edges = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.append([a - 1, b - 1])
mat = [[0] * N for _ in range(N)]
for s, g in edges:
    mat[s][g] = 1
    mat[g][s] = 1
ans = 0
for i in range(M):
    uni = UnionFind(N)
    for j in range(M):
        if i != j:
            uni.union(edges[j][0], edges[j][1])
    if not all(uni.find(0) == uni.find(x) for x in range(N)):
        ans += 1
print(ans)

+class UnionFind: +    def __init__(self, size): +        self.table = [i for i in range(size)] + +    def find(self, x): +        return self.table[x] + +    def union(self, x, y): +        x1 = self.find(x) +        y1 = self.find(y) +        if x1 == y1: +            return False +        for i in range(len(self.table)): +            if self.table[i] == y1: +                self.table[i] = x1 +        return True + + -nodes = [0] * N -    nodes[s] += 1 -    nodes[g] += 1 - - -def check(nodes): -    return all(n != 1 for n in nodes) - - -ans = 0 -while not check(nodes): -    for i in range(N): -        if nodes[i] == 1: -            for j in range(N): -                if mat[i][j]: -                    mat[i][j] = 0 -                    mat[j][i] = 0 -                    ans += 1 -                    nodes[i] -= 1 -                    nodes[j] -= 1 -                    break +for i in range(M): +    uni = UnionFind(N) +    for j in range(M): +        if i != j: +            uni.union(edges[j][0], edges[j][1]) +    if not all(uni.find(0) == uni.find(x) for x in range(N)): +        ans += 1