output_description: Print the number of the edges that are bridges among the M edges.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M  
      a_1 b_1  
      a_2 b_2
      :  
      a_M b_M
attempt: class UnionFind:
      def __init__(self, size):
          self.parent = list(range(size))
          self.height = [0] * size
          self.size = [1] * size
          self.component = size
  
      def root(self, index):
          if self.parent[index] == index:  # 根の場合
              return index
          rootIndex = self.root(self.parent[index])  # 葉の場合親の根を取得
          self.parent[index] = rootIndex  # 親の付け直し
          return rootIndex
  
      def union(self, index1, index2):  # 結合
          root1 = self.root(index1)
          root2 = self.root(index2)
  
          if root1 == root2:  # 連結されている場合
              return
  
          self.component -= 1  # 連結成分を減らす
  
          if self.height[root1] < self.height[root2]:
              self.parent[root1] = root2  # root2に結合
              self.size[root2] += self.size[root1]
          else:
              self.parent[root2] = root1  # root1に結合
              self.size[root1] += self.size[root2]
              if self.height[root1] == self.height[root2]:
                  self.height[root1] += 1
          return
  
      def isSameRoot(self, index1, index2):
          return self.root(index1) == self.root(index2)
  
      def sizeOfSameRoot(self, index):
          return self.size[self.root(index)]
  
      def getComponent(self):
          return self.component
  
  
  N, M = map(int, input().split())
  
  edges = [tuple(map(lambda a: int(a) - 1, input().split())) for _ in range(M)]
  
  
  def isBride(i):
      tree = UnionFind(N)
      for j, (a, b) in enumerate(edges):
          if i == j:
              continue
          tree.union(a, b)
      return tree.getComponent() > 1
  
  
  print(len([0 for i in range(M) if isBride(i)]))
  
problem_description: Statement
  
  You are given an undirected connected graph with N vertices and M edges that
  does not contain self-loops and double edges.  
  The i-th edge (1 \leq i \leq M) connects Vertex a_i and Vertex b_i.
  
  An edge whose removal disconnects the graph is called a _bridge_.  
  Find the number of the edges that are bridges among the M edges.
samples: [{"input": "7 7\n    1 3\n    2 7\n    3 4\n    4 5\n    4 6\n    5 6\n    6 7", "output": "4\n    \n\nThe figure below shows the given graph:\n\n![570677a9809fd7a5b63bff11e5d9bf79.png](https://img.atcoder.jp/abc075/570677a9809fd7a5b63bff11e5d9bf79.png)\n\nThe edges shown in red are bridges. There are four of them.\n\n* * *"}, {"input": "3 3\n    1 2\n    1 3\n    2 3", "output": "0\n    \n\nIt is possible that there is no bridge.\n\n* * *"}, {"input": "6 5\n    1 2\n    2 3\n    3 4\n    4 5\n    5 6", "output": "5\n    \n\nIt is possible that every edge is a bridge."}]