from collections import deque

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

edge_ls = [0] * m

for i in range(m):

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

    edge_ls[i] = [a,b]

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とyは-=1して使うのが基本

        '''

        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 size(self, x):

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



    def same(self, x, y):

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



    def members(self, x):

        root = self.find(x)

        return [i for i in range(self.n) if self.find(i) == root]



    def roots(self):

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



    def group_count(self):

        return len(self.roots())



    def all_group_members(self):

        return {r: self.members(r) for r in self.roots()}



    def __str__(self):

        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

edge_q = deque(edge_ls)

num_bridge = 0

for i in range(m):

    tar = edge_q.popleft()

    uf = UnionFind(n)

    for a,b in edge_q:

        a -= 1

        b -= 1

        uf.union(a,b)

    if not uf.group_count() == 1:

        num_bridge += 1

    edge_q.append(tar)

print(num_bridge)
from collections import deque

num_ver, num_edge = list(map(int,input().split()))

edges_ls = [0] * num_edge

for i in range(num_edge):

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

    a -= 1

    b -= 1

    edges_ls[i] = [a,b]



num_bridge = 0

for ind_take_edge in range(num_edge):

    graph_ls = [[] for _ in range(num_ver)]

    # graph_lsを作る

    for ind_edge in range(num_edge):

        if ind_edge != ind_take_edge:

            a,b = edges_ls[ind_edge]

            graph_ls[a].append(b)

            graph_ls[b].append(a)

    

    # 0からdfsしてdone_lsを仕上げていく

    done_ls = [0] * num_ver

    queue = deque()

    queue.append(0)

    while queue:

        now = queue.pop()

        done_ls[now] = 1

        for nex in graph_ls[now]:

            if done_ls[nex] != 1:

                queue.append(nex)

    

    if sum(done_ls) != num_ver:

        num_bridge += 1



print(num_bridge)



    



            



from collections import deque

n, m = list(map(int, input().split()))
edge_ls = [0] * m
for i in range(m):
    a, b = list(map(int, input().split()))
    edge_ls[i] = [a, b]


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とyは-=1して使うのが基本
        """
        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 size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

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

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

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return "\n".join("{}: {}".format(r, self.members(r)) for r in self.roots())


edge_q = deque(edge_ls)
num_bridge = 0
for i in range(m):
    tar = edge_q.popleft()
    uf = UnionFind(n)
    for a, b in edge_q:
        a -= 1
        b -= 1
        uf.union(a, b)
    if not uf.group_count() == 1:
        num_bridge += 1
    edge_q.append(tar)
print(num_bridge)

from collections import deque

num_ver, num_edge = list(map(int, input().split()))
edges_ls = [0] * num_edge
for i in range(num_edge):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edges_ls[i] = [a, b]
num_bridge = 0
for ind_take_edge in range(num_edge):
    graph_ls = [[] for _ in range(num_ver)]
    # graph_lsを作る
    for ind_edge in range(num_edge):
        if ind_edge != ind_take_edge:
            a, b = edges_ls[ind_edge]
            graph_ls[a].append(b)
            graph_ls[b].append(a)
    # 0からdfsしてdone_lsを仕上げていく
    done_ls = [0] * num_ver
    queue = deque()
    queue.append(0)
    while queue:
        now = queue.pop()
        done_ls[now] = 1
        for nex in graph_ls[now]:
            if done_ls[nex] != 1:
                queue.append(nex)
    if sum(done_ls) != num_ver:
        num_bridge += 1
print(num_bridge)

-n, m = list(map(int, input().split())) -edge_ls = [0] * m -for i in range(m): +num_ver, num_edge = list(map(int, input().split())) +edges_ls = [0] * num_edge +for i in range(num_edge): -    edge_ls[i] = [a, b] - - -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とyは-=1して使うのが基本 -        """ -        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 size(self, x): -        return -self.parents[self.find(x)] - -    def same(self, x, y): -        return self.find(x) == self.find(y) - -    def members(self, x): -        root = self.find(x) -        return [i for i in range(self.n) if self.find(i) == root] - -    def roots(self): -        return [i for i, x in enumerate(self.parents) if x < 0] - -    def group_count(self): -        return len(self.roots()) - -    def all_group_members(self): -        return {r: self.members(r) for r in self.roots()} - -    def __str__(self): -        return "\n".join("{}: {}".format(r, self.members(r)) for r in self.roots()) - - -edge_q = deque(edge_ls) +    a -= 1 +    b -= 1 +    edges_ls[i] = [a, b] -for i in range(m): -    tar = edge_q.popleft() -    uf = UnionFind(n) -    for a, b in edge_q: -        a -= 1 -        b -= 1 -        uf.union(a, b) -    if not uf.group_count() == 1: +for ind_take_edge in range(num_edge): +    graph_ls = [[] for _ in range(num_ver)] +    # graph_lsを作る +    for ind_edge in range(num_edge): +        if ind_edge != ind_take_edge: +            a, b = edges_ls[ind_edge] +            graph_ls[a].append(b) +            graph_ls[b].append(a) +    # 0からdfsしてdone_lsを仕上げていく +    done_ls = [0] * num_ver +    queue = deque() +    queue.append(0) +    while queue: +        now = queue.pop() +        done_ls[now] = 1 +        for nex in graph_ls[now]: +            if done_ls[nex] != 1: +                queue.append(nex) +    if sum(done_ls) != num_ver: -    edge_q.append(tar)