import java.io.{BufferedReader, InputStreamReader}

object Main extends App {

  val in = new BufferedReader(new InputStreamReader(System.in))
  val Array(n, m) = in.readLine.split(" ").map(_.toInt)
  val edges = Iterator.continually(in.readLine)
    .take(m)
    .map(_.split(" ").map(_.toInt))
    .toArray

  val graph = {
    val arr = Array.ofDim[Boolean](n+1,n+1)
    for(edge <- edges) {
      arr(edge(0))(edge(1)) = true
      arr(edge(1))(edge(0)) = true
    }
    arr
  }
  var visit = Array.ofDim[Boolean](n+1)

  def dfs(v:Int):Unit = {
    if(visit(v)) return
    visit(v) = true
    for(i <- 1 to n) {
      if(graph(v)(i)) dfs(i)
    }
  }

  val ans = {
    for(edge <- edges) yield {
      visit = Array.fill(n+1)(false)
      graph(edge(0))(edge(1)) = false
      graph(edge(1))(edge(0)) = false
      dfs(edge(0))
      // println(visit.mkString(" "))
      graph(edge(0))(edge(1)) = true
      graph(edge(1))(edge(0)) = true
      visit.tail.forall(_ == true)
    }
  }

  println(ans.count(_ == false))
}