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: # -*- coding: utf-8 -*-
  """
  Created on Thu Sep 12 10:38:04 2019
  C - Bridge
  実行時間制限: 2 sec / メモリ制限: 256 MB
  
  配点 : 
  300
   点
  @author: justwah
  use union find
  """
  
  import sys
  
  read = sys.stdin.readline
  
  n, m = map(int, input().split())  # single line use regular input() is faster
  
  l = [
      list(tuple(map(int, read().split()))) for i in range(m)
  ]  # multiple lines use sys.stdin.readline faster
  
  
  def root(x):  # recursively find root for a node
      if parent[x] < 0:  # if at root, return self
          return x
      else:
          parent[x] = root(
              parent[x]
          )  # while searching rejoint queried node to a common parent for hierarchical tree
          return parent[x]
  
  
  def merge(a, b):
      a = root(a)
      b = root(b)
      if rank[a] < rank[b]:  # joint lower rank node to a higher rank one
          parent[a] = b
      else:
          parent[b] = a
          if rank[a] == rank[b]:  # rank only change if two same rank node joined
              rank[a] += 1
      return
  
  
  score = 0
  
  for i in range(m):
      parent = [-1] * (n + 1)
      rank = [0] * (n + 1)
      for j, (a, b) in enumerate(
          l[i:]
      ):  # iteraete from different starting point - test different "last bridge"
          a = root(a)
          b = root(b)
          if a != b:
              merge(a, b)
          else:
              if j == (len(l) - 1):  # if the last bridge is redundant, +1
                  score += 1
  
  print(m - score)
  
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."}]