#!/usr/bin/env python3

class UnionFind():

    def __init__(self, n):

        self.n = n

        self.parents = [-1] * n



    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

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

            return self.parents[x]



    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)



        if x == y:

            return



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

            x, y = y, x



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

        self.parents[y] = x

    



    def same(self, x, y):

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

        

import numpy as np

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

edge = []

for _ in range(M):

    edge.append(list(map(int, input().split())))

ans = 0 

for i in range(M):

    unionfind = UnionFind(N)

    for j in [k for k in range(M) if k != i]:

        a, b = edge[j][0] - 1, edge[j][1] - 1

        unionfind.union(a, b)

    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2:

        ans += 1

print(ans)
#!/usr/bin/env python3

from collections import deque

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

edge = []

for _ in range(M):

    edge.append(list(map(int, input().split())))

ans = 0 

for i in range(M):

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

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

    for j in [k for k in range(M) if k != i]:

        a, b = edge[j][0], edge[j][1]

        renketu[a].append(b)

        renketu[b].append(a)

    q = deque([1])

    while q:

        now = q.pop()

        done[now] = False



        for r in renketu[now]:

            if done[r]:

                q.append(r)

    if sum(done) > 1:

        ans += 1

print(ans)
#!/usr/bin/env python3
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

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


import numpy as np

N, M = list(map(int, input().split()))
edge = []
for _ in range(M):
    edge.append(list(map(int, input().split())))
ans = 0
for i in range(M):
    unionfind = UnionFind(N)
    for j in [k for k in range(M) if k != i]:
        a, b = edge[j][0] - 1, edge[j][1] - 1
        unionfind.union(a, b)
    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2:
        ans += 1
print(ans)

#!/usr/bin/env python3
from collections import deque

N, M = list(map(int, input().split()))
edge = []
for _ in range(M):
    edge.append(list(map(int, input().split())))
ans = 0
for i in range(M):
    done = [True for _ in range(N + 1)]
    renketu = [[] for _ in range(N + 1)]
    for j in [k for k in range(M) if k != i]:
        a, b = edge[j][0], edge[j][1]
        renketu[a].append(b)
        renketu[b].append(a)
    q = deque([1])
    while q:
        now = q.pop()
        done[now] = False
        for r in renketu[now]:
            if done[r]:
                q.append(r)
    if sum(done) > 1:
        ans += 1
print(ans)

-class UnionFind: -    def __init__(self, n): -        self.n = n -        self.parents = [-1] * n - -    def find(self, x): -        if self.parents[x] < 0: -            return x -        else: -            self.parents[x] = self.find(self.parents[x]) -            return self.parents[x] - -    def union(self, x, y): -        x = self.find(x) -        y = self.find(y) -        if x == y: -            return -        if self.parents[x] > self.parents[y]: -            x, y = y, x -        self.parents[x] += self.parents[y] -        self.parents[y] = x - -    def same(self, x, y): -        return self.find(x) == self.find(y) - - -import numpy as np +from collections import deque -    unionfind = UnionFind(N) +    done = [True for _ in range(N + 1)] +    renketu = [[] for _ in range(N + 1)] -        a, b = edge[j][0] - 1, edge[j][1] - 1 -        unionfind.union(a, b) -    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2: +        a, b = edge[j][0], edge[j][1] +        renketu[a].append(b) +        renketu[b].append(a) +    q = deque([1]) +    while q: +        now = q.pop() +        done[now] = False +        for r in renketu[now]: +            if done[r]: +                q.append(r) +    if sum(done) > 1: