from scipy.sparse.csgraph import floyd_warshall



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

l=[list(map(int,input().split())) for i in range(m)]



ans=0

for i in range(m):

    ll=l[:i]+l[i+1:]



    d=[[float('inf')]*n for i in range(n)]

    for i in range(n):

        d[i][i]=0



    for j in ll:

        d[j[0]-1][j[1]-1]=1

        d[j[1]-1][j[0]-1]=1



    d=floyd_warshall(d)



    if float('inf') in d:

        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 roots(self):

        return [i for i, x in enumerate(self.parents) if x < 0]



    def group_count(self):

        return len(self.roots())



from copy import deepcopy



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

l=[list(map(int,input().split())) for i in range(m)]



cnt=0

for i in range(m):

  uf=UnionFind(n)

  ll=deepcopy(l)

  del ll[i]

  for a,b in ll:

    a-=1

    b-=1

    uf.union(a,b)

  if uf.group_count()>=2:

    cnt+=1

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

n, m = list(map(int, input().split()))
l = [list(map(int, input().split())) for i in range(m)]
ans = 0
for i in range(m):
    ll = l[:i] + l[i + 1 :]
    d = [[float("inf")] * n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    for j in ll:
        d[j[0] - 1][j[1] - 1] = 1
        d[j[1] - 1][j[0] - 1] = 1
    d = floyd_warshall(d)
    if float("inf") in d:
        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 roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())


from copy import deepcopy

n, m = list(map(int, input().split()))
l = [list(map(int, input().split())) for i in range(m)]
cnt = 0
for i in range(m):
    uf = UnionFind(n)
    ll = deepcopy(l)
    del ll[i]
    for a, b in ll:
        a -= 1
        b -= 1
        uf.union(a, b)
    if uf.group_count() >= 2:
        cnt += 1
print(cnt)

-from scipy.sparse.csgraph import floyd_warshall +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 roots(self): +        return [i for i, x in enumerate(self.parents) if x < 0] + +    def group_count(self): +        return len(self.roots()) + + +from copy import deepcopy -ans = 0 +cnt = 0 -    ll = l[:i] + l[i + 1 :] -    d = [[float("inf")] * n for i in range(n)] -    for i in range(n): -        d[i][i] = 0 -    for j in ll: -        d[j[0] - 1][j[1] - 1] = 1 -        d[j[1] - 1][j[0] - 1] = 1 -    d = floyd_warshall(d) -    if float("inf") in d: -        ans += 1 -print(ans) +    uf = UnionFind(n) +    ll = deepcopy(l) +    del ll[i] +    for a, b in ll: +        a -= 1 +        b -= 1 +        uf.union(a, b) +    if uf.group_count() >= 2: +        cnt += 1 +print(cnt)