N, M = (int(x) for x in input().split())

edge = [tuple(int(x) for x in input().split()) for _ in range(M)]



import numpy as np

from scipy.sparse.csgraph import floyd_warshall

INF = 100

tmpl_graph = [[INF if i != j else 0 for j in range(N)] for i in range(N)]



ans = 0

for E in edge:

    edgeWithoutE = edge.copy()

    edgeWithoutE.remove(E)

    graph = np.array(tmpl_graph)

    for x in edgeWithoutE:

        graph[x[0]-1,x[1]-1] = 1

        graph[x[1]-1,x[0]-1] = 1

    graph = floyd_warshall(graph,directed=False)

    if len(graph[graph == 100]) > 0:

        ans += 1

print(ans)


class node:

    def __init__(self, id):

        self.id = id

        self.root = self



    def findRoot(self):

        if self == self.root:

            return self

        else:

            self.root = self.root.findRoot()

            return self.root



    def resetRoot(self):

        self.root = self



class Tree:

    def __init__(self, num):

        self.nodes = {i:node(i) for i in range(num)}



    def union(self, one, other):

        root1 = one.findRoot()

        root2 = other.findRoot()

        root1.root = root2.root = self.nodes[min(root1.id, root2.id)]



    def resetTree(self):

        for n in list(self.nodes.values()):

            n.resetRoot()



    def makeTree(self, Edge):

        self.edge = Edge

        for x,y in Edge:

            self.union(self.nodes[x-1], self.nodes[y-1])





def main():

    with open(0) as f:

        N, M = list(map(int, f.readline().split()))

        Edge = [tuple(map(int, line.split())) for line in f.readlines()]

    

    tree = Tree(N)

    ans = 0

    for i in range(M):

        edge = [v for  v in Edge if v != Edge[i]]

        tree.makeTree(edge)

        if any(x.findRoot().id != 0 for x in list(tree.nodes.values())):

            ans += 1

        tree.resetTree()

    print(ans)



if __name__ == '__main__':

    main()
N, M = (int(x) for x in input().split())
edge = [tuple(int(x) for x in input().split()) for _ in range(M)]
import numpy as np
from scipy.sparse.csgraph import floyd_warshall

INF = 100
tmpl_graph = [[INF if i != j else 0 for j in range(N)] for i in range(N)]
ans = 0
for E in edge:
    edgeWithoutE = edge.copy()
    edgeWithoutE.remove(E)
    graph = np.array(tmpl_graph)
    for x in edgeWithoutE:
        graph[x[0] - 1, x[1] - 1] = 1
        graph[x[1] - 1, x[0] - 1] = 1
    graph = floyd_warshall(graph, directed=False)
    if len(graph[graph == 100]) > 0:
        ans += 1
print(ans)

class node:
    def __init__(self, id):
        self.id = id
        self.root = self

    def findRoot(self):
        if self == self.root:
            return self
        else:
            self.root = self.root.findRoot()
            return self.root

    def resetRoot(self):
        self.root = self


class Tree:
    def __init__(self, num):
        self.nodes = {i: node(i) for i in range(num)}

    def union(self, one, other):
        root1 = one.findRoot()
        root2 = other.findRoot()
        root1.root = root2.root = self.nodes[min(root1.id, root2.id)]

    def resetTree(self):
        for n in list(self.nodes.values()):
            n.resetRoot()

    def makeTree(self, Edge):
        self.edge = Edge
        for x, y in Edge:
            self.union(self.nodes[x - 1], self.nodes[y - 1])


def main():
    with open(0) as f:
        N, M = list(map(int, f.readline().split()))
        Edge = [tuple(map(int, line.split())) for line in f.readlines()]
    tree = Tree(N)
    ans = 0
    for i in range(M):
        edge = [v for v in Edge if v != Edge[i]]
        tree.makeTree(edge)
        if any(x.findRoot().id != 0 for x in list(tree.nodes.values())):
            ans += 1
        tree.resetTree()
    print(ans)


if __name__ == "__main__":
    main()

-N, M = (int(x) for x in input().split()) -edge = [tuple(int(x) for x in input().split()) for _ in range(M)] -import numpy as np -from scipy.sparse.csgraph import floyd_warshall +class node: +    def __init__(self, id): +        self.id = id +        self.root = self -INF = 100 -tmpl_graph = [[INF if i != j else 0 for j in range(N)] for i in range(N)] -ans = 0 -for E in edge: -    edgeWithoutE = edge.copy() -    edgeWithoutE.remove(E) -    graph = np.array(tmpl_graph) -    for x in edgeWithoutE: -        graph[x[0] - 1, x[1] - 1] = 1 -        graph[x[1] - 1, x[0] - 1] = 1 -    graph = floyd_warshall(graph, directed=False) -    if len(graph[graph == 100]) > 0: -        ans += 1 -print(ans) +    def findRoot(self): +        if self == self.root: +            return self +        else: +            self.root = self.root.findRoot() +            return self.root + +    def resetRoot(self): +        self.root = self + + +class Tree: +    def __init__(self, num): +        self.nodes = {i: node(i) for i in range(num)} + +    def union(self, one, other): +        root1 = one.findRoot() +        root2 = other.findRoot() +        root1.root = root2.root = self.nodes[min(root1.id, root2.id)] + +    def resetTree(self): +        for n in list(self.nodes.values()): +            n.resetRoot() + +    def makeTree(self, Edge): +        self.edge = Edge +        for x, y in Edge: +            self.union(self.nodes[x - 1], self.nodes[y - 1]) + + +def main(): +    with open(0) as f: +        N, M = list(map(int, f.readline().split())) +        Edge = [tuple(map(int, line.split())) for line in f.readlines()] +    tree = Tree(N) +    ans = 0 +    for i in range(M): +        edge = [v for v in Edge if v != Edge[i]] +        tree.makeTree(edge) +        if any(x.findRoot().id != 0 for x in list(tree.nodes.values())): +            ans += 1 +        tree.resetTree() +    print(ans) + + +if __name__ == "__main__": +    main()